bkui-vue 0.0.2-beta.6 → 0.0.2-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -63,7 +63,7 @@ ${Gl(n)}`),i}})}function Sw(e){const t=Object.keys(e),n=t.filter(s=>{var o;retur
63
63
  * @return {boolean} True if the event is supported.
64
64
  * @internal
65
65
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
66
- */function T7(e,t){if(!Tm.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&xm&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var x7=T7,k7=M7,S7=x7,A3=10,E3=40,P3=800;function km(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*A3,s=n*A3,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=E3,s*=E3):(i*=P3,s*=P3)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}km.getEventType=function(){return k7.firefox()?"DOMMouseScroll":S7("wheel")?"wheel":"mousewheel"};var D7=km,j7=D7;const O7=Fs(j7),A7=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,E7=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(A7?"DOMMouseScroll":"mousewheel",function(n){const i=O7(n);t==null||t.apply(this,[n,i])})},P7={beforeMount(e,t){console.error(e,t),E7(e,t.value)}},ua=new Map,$r={beforeMount(e,t){const n=z3(t),{trigger:i}=n,s=V7(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{Bd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{gs(e)},100)}),e.addEventListener("click",()=>{gs(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{gs(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{Bd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&gs(e)});ua.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){ua.get(e).opts=z3(t)},unmounted(e){gs(e),ua.delete(e)}};function z7(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function z3(e){const t=z7();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function V7(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=vi.getPopperIndex(),u=document.createElement("div");if(u.className=`${Gt("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=Sm();u.appendChild(f)}return u}function Sm(){const e=document.createElement("div");return e.className=Gt("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function R7(e,t){const{opts:n}=ua.get(e),{placement:i,distance:s,showOnInit:o}=n,c=dg(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&Bd(e),c}function Bd(e){const{popper:t,opts:n}=ua.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=Sm();t.appendChild(f)}document.body.appendChild(t);const u=R7(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),ua.get(e).popperInstance=u}function gs(e){if(!ua.get(e))return;const{popper:t,popperInstance:n,opts:i}=ua.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const V3=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},dh=(e,t)=>{let n=null,i=null,s=null;const o=V3(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const v=V3(e,t);v.isShow=!0,v.content=v.content||e.innerHTML,v.allowHtml=!0,Object.assign(v,{onContentMouseenter:u,onContentMouseleave:f}),n=uh(v)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:v=>{var y,C;h(),(y=v??e)==null||y.removeEventListener("mouseenter",d),(C=v??e)==null||C.removeEventListener("mouseleave",h)},instance:n}},J7={mounted(e,t){dh(e,t)}},Q7={onContentScroll:Function},_7={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def(Gt("F-scroll-x")),scrollYName:p.string.def(Gt("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...Q7},W7=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,v,y,C,b)=>{t.emit("content-scroll",[d,{translateY:y,translateX:C,pos:b}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,v,y,C,b,T;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((v=(m=t.slots).default)==null?void 0:v.call(m,{data:e.list}))??""]),[[o,c]]),((C=(y=t.slots).afterContent)==null?void 0:C.call(y))??"",((T=(b=t.slots).afterSection)==null?void 0:T.call(b))??""])}}};function R3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function Dm(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:v}=n,{offsetHeight:y}=i;let C=0,b=0,T=0;if(typeof e=="number"&&(C=Math.floor(o/e),b=Math.ceil(y/e)+C,T=o%e),typeof e=="function"){const N=R3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,T=N.diffHeight,b=R3(f,y,d,e).startIndex+C+1}if(o!==u||C!==h||b!==m||v!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,C,b,o,T,c,{bottom:N>=0?N:0})}}function H7(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const y=t.scrollTop,C=t.scrollLeft,b=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,y,y,C,{bottom:b>=0?b:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:v}=o;Dm(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:v},t,e)}const jm=(e=60)=>st.throttle((t,n,i)=>H7(t,n,i),e),B7=(e,t,n,i=60)=>{Reflect.apply(jm(i),void 0,[e,t,n])},F7={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{B7(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",jm)}}},$7=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:F7},props:_7,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=W7(e,t);return D}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(D,E,P,O,R,J,G)=>{c.startIndex=E,c.endIndex=P,c.scrollTop=O,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),v()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),v(),e.keepAlive&&S(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),v()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let O=0;O<d.value;O++){const R=e.lineHeight.call(this,O,D.slice(O*e.groupItemCount,e.groupItemCount));P+=typeof R=="number"?R:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},v=(D={left:0,top:0})=>{var P;const E=(P=o.value)==null?void 0:P.parentNode;Dm(e.lineHeight,u,c,E,null),D&&o.value&&S(D)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,E)=>({...D,$index:E}))),C=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),b=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?b.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:k}=ye(),w=a.computed(()=>[k("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?k("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?k("virtual-content"):"",...s(e.contentClassName)]),x=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},_=()=>{f(),v()},S=(D={left:0,top:0})=>{const{left:E,top:P}=D;o.value.scrollTo(E,P)};return t.expose({reset:_,scrollTo:S}),()=>{var D,E,P,O,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((E=(D=t.slots).beforeContent)==null?void 0:E.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((O=(P=t.slots).default)==null?void 0:O.call(P,{data:C.value}))??""]),[[x,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[k("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}),Gr=Ue($7);var Om=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(Om||{});const G7=a.defineComponent({name:"Tag",props:{theme:Ul(),closable:p.bool.def(!1),type:ze("tagStorkeType",{}).def(Om.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=a.computed(()=>Ee({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(mn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Qr=Ue(G7),Z7=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:Ul(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),{proxy:i}=a.getCurrentInstance(),s=a.inject(Sc,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},v=()=>{var N;(N=d.value)==null||N.focus()},y=N=>{t("update:modelValue",N.target.value)},C=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},b=N=>{const k=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?k[N]:k},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=b(),k=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=k>0?k:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:v,handleInput:y,handleKeydown:C,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Ee({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Ee({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((v,y)=>a.createVNode(Qr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&y>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(v.value)},{default:()=>{var C;return[(C=this.select)==null?void 0:C.handleGetLabelByValue(v.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Qr,{class:this.resolveClassName("select-overflow-tag")},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),Y7=a.defineComponent({name:"Select",directives:{clickoutside:bi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(Nf.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:Ul(),behavior:xg(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:zw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ht("select"),{resolveClassName:i}=ye(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:v,allowCreate:y,customContent:C,showSelectedIcon:b,inputSearch:T,enableVirtualRender:N,showSelectAll:k,scrollHeight:w,list:I,displayKey:x,idKey:L,collapseTags:_,autoHeight:S,popoverOptions:D,allowEmptyValues:E,autoFocus:P,keepSearchValue:O,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),ge=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),me=ei(),B=a.ref(),Z=a.ref(),H=a.ref(),V=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),te=a.ref(new Map),oe=a.computed(()=>[...te.value.values()]),W=a.ref(new Map),Q=a.ref([]),$=a.computed(()=>Q.value.reduce((Ne,De)=>(Ne[De.value]=De.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,De)=>(Ne[De[L.value]]=De[x.value],Ne),{}));a.watch(s,()=>{var Ne;co(),e.withValidate&&((Ne=me==null?void 0:me.validate)==null||Ne.call(me,"change"))},{deep:!0}),a.watch(Q,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ct.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var De;return(De=hr(String(Ne[x.value])))==null?void 0:De.includes(hr(ni.value))})),de=a.computed(()=>o.value||d.value),be=a.computed(()=>Q.value.map(Ne=>{var De,We;return((We=(De=te.value)==null?void 0:De.get(Ne.value))==null?void 0:We.optionName)||fe.value[Ne.value]||Ne.label})),Ie=a.computed(()=>{const Ne=oe.value.reduce((De,We)=>(We.disabled||De.push(We.optionID),De),[]);return Ne.length<=Q.value.length&&Ne.every(De=>Q.value.some(We=>We.value===De))}),Se=a.computed(()=>!!W.value.size),Ve=a.computed(()=>!oe.value.length),Pe=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),Ce=a.computed(()=>!(Yr.value||Ve.value||Pe.value)||C.value),Le=a.computed(()=>u.value&&k.value&&(!ni.value||!c.value)),Re=a.computed(()=>w.value-12-(Le.value?32:0)),at=a.computed(()=>Yr.value?ie.value:Ve.value?J.value:Pe.value?G.value:""),nt=a.computed(()=>S.value?_.value&&!ti.value:_.value),ct=a.computed(()=>st.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:oo.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:Yl.AUTO},D.value)),{register:He,unregister:Ae}=Pd(te),{register:Be,unregister:ot}=Pd(W),{isHover:qe,setHover:mt,cancelHover:Ze}=ym(),Qt=a.ref(!1),Hi=()=>{Qt.value||(Qt.value=!0,t("focus"))},so=()=>{Qt.value&&(Qt.value=!1,t("blur"))},{popperWidth:oo,isPopoverShow:ti,hidePopover:Bi,showPopover:Zr,togglePopover:Jc}=p7({popoverMinWidth:h.value},Z);a.watch(ti,()=>{t("toggle",ti.value)});const Qc=a.computed(()=>(c.value&&T.value||y.value)&&ti.value);a.watch(ti,Ne=>{Ne?setTimeout(()=>{ya(),lo()},10):O.value||(ni.value="")});const lo=()=>{var We;const Ne=Q.value[0],De=te.value.get(Ne==null?void 0:Ne.value);De&&!De.disabled&&De.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(We=oe.value.find(vn=>!vn.disabled&&vn.visible))==null?void 0:We.optionID},_c=Ne=>{c.value&&oe.value.forEach(De=>{var We;De.visible=(We=hr(String(De.optionName)))==null?void 0:We.includes(hr(Ne))})},{searchKey:ni,searchLoading:Yr}=v7(ce.value?f.value:_c,lo),ii=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},Wc=()=>{de.value||(Hi(),Jc())},Ur=Ne=>{c.value&&(ni.value=Ne)},Hc=(Ne,De)=>{const We=String(Ne);!y.value||!We||c.value&&oe.value.find(en=>hr(String(en.optionName))===hr(We))||te.value.get(We)||(De.stopPropagation(),u.value?(Q.value.push({value:We,label:We}),ii(Q.value.map(en=>en.value))):(Q.value=[{value:We,label:We}],ii(We),Bi()),ni.value="")},va=Ne=>{if(!(de.value||!Ne)){if(u.value){const De=Q.value.findIndex(We=>We.value===Ne.optionID);De>-1?Q.value.splice(De,1):Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),ii(Q.value.map(We=>We.value))}else Q.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],ii(Ne.optionID),Bi();ya()}},ya=()=>{setTimeout(()=>{var Ne,De,We;!T.value&&!y.value?(Ne=V.value)==null||Ne.focus():v.value==="tag"?(De=Y.value)==null||De.focus():(We=B.value)==null||We.focus()},0)},Bc=Ne=>{Ne.stopPropagation(),Q.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Bi()},Fc=()=>{ee.value=""},$c=()=>{Ie.value?Q.value=[]:oe.value.forEach(Ne=>{Ne.disabled||Q.value.find(De=>De.value===Ne.optionID)||Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),ii(Q.value.map(Ne=>Ne.value)),ya()},Gc=Ne=>{const{scrollTop:De,clientHeight:We,scrollHeight:vn}=Ne.target;De+We===vn&&t("scroll-end")},Zc=Ne=>{if(de.value)return;const De=Q.value.findIndex(We=>We.value===Ne);De>-1&&(Q.value.splice(De,1),ii(Q.value.map(We=>We.value)))},Kr=Ne=>{var We,vn;let De=Ne;if(typeof De=="object"){for(const en of te.value.keys())if(st.isEqual(en,De)){De=en;break}}return((vn=(We=te.value)==null?void 0:We.get(De))==null?void 0:vn.optionName)||fe.value[De]||$.value[De]||De},co=()=>{Array.isArray(s.value)?Q.value=[...s.value.map(Ne=>({value:Ne,label:Kr(Ne)}))]:s.value!==void 0||E.value.includes(s.value)?Q.value=[{value:s.value,label:Kr(s.value)}]:Q.value=[]},uo=Ne=>{var vn,en;if(!ti.value)return;const De=oe.value.filter(tn=>!tn.disabled&&tn.visible),We=De.findIndex(tn=>tn.optionID===ee.value);if(!(!De.length||We===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const tn=We>=De.length-1?0:We+1;ee.value=(vn=De[tn])==null?void 0:vn.optionID;break}case"ArrowUp":{Ne.preventDefault();const tn=We===0?De.length-1:We-1;ee.value=(en=De[tn])==null?void 0:en.optionID;break}case"Backspace":{if(!u.value||!Q.value.length||ni.value.length||Ne.target===V.value)return;Q.value.pop(),ii(Q.value.map(tn=>tn.value));break}case"Enter":{const tn=te.value.get(ee.value);va(tn);break}}},Yc=({event:Ne})=>{var We;const{target:De}=Ne;(We=Z.value)!=null&&We.contains(De)||Z.value===De||(Bi(),so())},Uc=()=>{setTimeout(()=>{var Ne,De;N.value&&((De=(Ne=X.value)==null?void 0:Ne.reset)==null||De.call(Ne))})};return a.provide(Sc,a.reactive({multiple:u,selected:Q,activeOptionValue:ee,showSelectedIcon:b,selectedStyle:R,register:He,unregister:Ae,registerGroup:Be,unregisterGroup:ot,handleOptionSelected:va,handleGetLabelByValue:Kr})),a.onMounted(()=>{co(),setTimeout(()=>{m.value&&Zr(),P.value&&ya()})}),{selected:Q,isInput:Qc,options:oe,isDisabled:de,selectedLabel:be,isPopoverShow:ti,isHover:qe,popperWidth:oo,inputRef:B,triggerRef:Z,contentRef:H,searchRef:V,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Yr,isOptionsEmpty:Ve,isSearchEmpty:Pe,isFocus:Qt,isShowSelectContent:Ce,curContentText:at,isGroup:Se,searchKey:ni,isShowSelectAll:Le,virtualHeight:Re,virtualList:K,isCollapseTags:nt,popoverConfig:ct,focusInput:ya,setHover:mt,cancelHover:Ze,handleFocus:Hi,handleBlur:so,handleTogglePopover:Wc,handleClear:Bc,hidePopover:Bi,showPopover:Zr,handleToggleAll:$c,handleOptionSelected:va,handleClickOutside:Yc,handleScroll:Gc,handleDeleteTag:Zc,handleInputChange:Ur,handleInputEnter:Hc,handleKeydown:uo,handleSelectedAllOptionMouseEnter:Fc,handlePopoverShow:Uc,localLoadingText:ie,localPlaceholder:ge,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Ee({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode(ca,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(pn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ya,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Z7,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(Ba,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(Ua,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode(ca,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Gr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(Dl,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(Dl,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode(ca,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Kt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),fh=Xt(Y7,{Option:Dl,Group:y7});function U7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:K7}=Fa,hh=Object.assign({},K7);hh.width.default="400";hh.height.default="100%";const X7=a.defineComponent({name:"Sideslider",components:{BkModal:Fa,BkButton:Pt},props:{...hh,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=ye();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode(Fa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),U7(u)?u:{default:()=>[u]})}}}),Am=Ue(X7);var Em=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Em||{});const J3={theme:p.theme().def(Zl.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:Ig(),status:ze("status",{}).def(Em.UNKNOWN),lineType:Lg(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},q7=a.defineComponent({name:"Steps",props:J3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ht("steps"),i=ht("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(v=>{typeof v=="string"?m.push(v):m.push({title:v.title,icon:v.icon,description:v.description,status:v.status,border:v.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{J3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,v)=>{const y=await e.beforeChange(h);y?m(y):v(y)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=ye();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Ee({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:v}=m;return v?Object.prototype.toString.call(v)==="[object Object]":typeof m=="string"},u=(m,v)=>(v.icon||(v.icon=m),!isNaN(v.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,v)=>o(m)&&this.status==="loading"||f(v)?a.createVNode(Ks,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(v)?a.createVNode(mn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(ga,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,v)?m+1:a.createVNode(v.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,v)=>{var y,C;return a.createVNode("div",{class:[this.resolveClassName("steps"),m.title?"":this.resolveClassName("step-no-content"),s(v)?"done":"",o(v)?"current":"",o(v)&&this.status==="error"?"isError":"",m.status&&o(v)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(v+1)}},[((C=(y=this.$slots)[v+1])==null?void 0:C.call(y))??h(v,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(v+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}}),Pm=Ue(q7),eL=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=ei(),{resolveClassName:i}=ye(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const v=`${i(`bswitcher-${e.size}`)}`;m[v]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const v=o.value?e.falseValue:e.trueValue,y=!o.value,C=()=>{t("update:modelValue",v),t("change",y)};let b=!0;if(typeof e.beforeChange=="function"&&(b=e.beforeChange(v),typeof b.then=="function"))return s.value=!0,b.then(()=>{C()}).finally(()=>{s.value=!1});b&&C()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(yc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),zm=Ue(eL);var jl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(jl||{}),Vm=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(Vm||{});const tL=["auto","highlight"],nL=["none","row","col","outer","horizontal"];var Rn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Rn||{}),jt=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(jt||{});const At=(...e)=>!0,iL={columnPick:At,columnFilter:At,columnSort:At,colFilterSave:At,rowClick:At,rowDblclick:At,rowExpand:At,select:At,selectAll:At,selectionChange:At,pageLimitChange:At,pageValueChange:At,settingChange:At,scrollBottom:At,cellClick:At,cellDblclick:At,rowMouseEnter:At,rowMouseLeave:At},$e={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Kn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},_r=6,Pa=42,vl={large:78,medium:60,small:42},aL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:vl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:vl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:vl.large}],Rm="InitColumns",Jm="BKTableCahce",rL="Bk_COlumn_Update_Define";var Et=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Et||{});const sL=["asc","desc","null","custom"],Cr=80;var Qm=(e=>(e.CURRENT="current",e.ALL="all",e))(Qm||{});const gh=ze("showOverflowTooltipMode",{default:"auto"}),oL=ze("columnType",{default:"none"}),Fd=ze("columnType",{default:""}),lL=ze("full",{default:"full"});var _m=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(_m||{});const Wm=ze("columnSize",{default:"small"}),cL=fn(),Q3=ze("sortScope",{}).def("current");var Hm=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(Hm||{});const Bm={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.oneOfType([p.string,p.func]),disabled:p.oneOfType([p.bool,p.func]),watchCellResize:p.bool.def(!0),mode:gh})]).def(void 0),type:oL,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,cL]).def(!1),sort:p.oneOfType([p.shape({sortFn:p.func.def(void 0),sortScope:Q3,value:p.string.def(Et.NULL)}),p.bool,p.string]).def(!1),filter:p.oneOfType([p.shape({list:p.arrayOf(p.any).def([]),filterFn:p.func.def(void 0),match:lL,checked:p.arrayOf(p.any).def([]),filterScope:Q3,btnSave:p.oneOfType([p.bool,p.string]).def("确定"),btnReset:p.oneOfType([p.bool,p.string]).def("重置")}),p.bool,p.string]).def(!1),colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:Fd,className:p.oneOfType([p.string,p.func])},uL={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(p.shape(Bm).loose).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ze("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),minHeight:p.oneOfType([p.number,p.string]).def(Pa*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(Pa),headHeight:p.number.def(Pa),showHead:p.bool.def(!0),thead:p.shape({height:p.number.def(Pa),isShow:p.bool.def(!0),cellFn:p.func.def(void 0)}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ze("boderType",{})),p.string]).def([jl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(60),remotePagination:p.bool.def(!1),emptyText:p.string,settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:Wm,sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def($e.ROW_INDEX),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:gh})]).def(!1),asyncData:p.bool.def(!1),rowHover:p.oneOf(tL).def(Vm.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ze("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:Fd,headerAlign:Fd,prependStyle:p.style().def({})},dL=a.defineComponent({name:"TableColumn",props:{...Bm,prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},setup(e){const t=a.inject(Rm,(s,o=!1)=>{},!1),n=a.inject(Jm,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(rL,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class fL{constructor(){ke(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}const _3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},hL=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=_3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(y,C,b)=>{typeof C=="function"&&y.sort((T,N)=>C(T,N,b[Kn.SORT_TYPE]))},d=(y,C)=>{if(typeof C=="function"){const b=y.filter((T,N)=>C(T,N,t));y.length=0,y.push(...b)}},h=(y,C,b)=>{const T=t.slice(),{sortScope:N}=(b==null?void 0:b.sort)??{};N===Qm.ALL&&f(T,C,b),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,y),f(u,C,b)},m=(y,C,b)=>{s=_3(e.pagination,s),v(),c(),h(y,C,b)},v=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},gL=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Qa.Normal,mode:nh.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:v,indicator:y}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode(ca,{loading:f,size:d,mode:h,title:m,inline:v,indicator:y},null)}}}};function mL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const pL=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=ye();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(fh,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},mL(f=t.limitList.map((d,h)=>a.createVNode(Dl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},ka=5,vL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const C=[];if(e.totalPageNum<=ka+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(ka/2);e.totalPageNum>ka&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const T=Math.min(e.totalPageNum-ka,Math.max(2,t.value-b));for(let N=T;N<T+ka;N++)C.push(N);return C});a.watch(()=>e.modelValue,C=>{a.nextTick(()=>{C>=1&&C<=e.totalPageNum?t.value=C:C<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,C=>{t.value>C&&(t.value=C)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=C=>{C!==t.value&&(t.value=C)},h=()=>{t.value=Math.max(1,t.value-ka)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+ka)},{resolveClassName:v}=ye();return{current:t,render:({isFirst:C,isLast:b})=>a.createVNode("div",{class:{[`${v("pagination-list")}`]:!0,"is-first":C,"is-last":b}},[a.createVNode("div",{class:{[`${v("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(Ci,null,null)]),a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${v("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(Rs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${v("pagination-list-next-batch")}`,onClick:m},[a.createVNode(Rs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${v("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(Wn,null,null)])])}},yL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let k=1;k<=e.totalPageNum;k++)N.push(k);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},v=N=>{const k=N.target,w=Number(k.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},y=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},C=N=>{c=N,m()},{resolveClassName:b}=ye();return{current:i,render:()=>a.createVNode("div",{class:`${b("pagination-small-list")}`},[a.createVNode("div",{class:{[`${b("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(Ci,null,null)]),a.createVNode(Kt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${b("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${b("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:v,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${b("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${b("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>C(N)},[N]))])}),a.createVNode("div",{class:{[`${b("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(Wn,null,null)])])}},CL=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=ye();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},bL={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},wL=a.defineComponent({name:"Pagination",props:bL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ht("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=CL(n),{current:u,render:f}=vL(),{current:d,render:h}=yL(),{limit:m,render:v}=pL(n);a.watch([s,m,o],([C,b])=>{const T=Math.ceil(C/b);i.value=T<1?1:T},{immediate:!0}),a.watch(u,C=>{t.emit("update:modelValue",C),t.emit("change",C)}),a.watch(d,C=>{e.small&&(t.emit("update:modelValue",C),t.emit("change",C))}),a.watch(m,C=>{t.emit("limitChange",C)});const{resolveClassName:y}=ye();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:v,renderSmallList:h,resolveClassName:y}},render(){const e=Ee({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}),mh=Ue(wL);var Fm=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),$d=typeof window<"u"&&typeof document<"u"&&window.document===document,Ol=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),NL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ol):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ML=2;function IL(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){NL(o)}function u(){var f=Date.now();if(n){if(f-s<ML)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var LL=20,TL=["top","right","bottom","left","width","height","size","weight"],xL=typeof MutationObserver<"u",kL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=IL(this.refresh.bind(this),LL)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!$d||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xL?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!$d||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=TL.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),$m=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},Wr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ol},Gm=Dc(0,0,0,0);function Al(e){return parseFloat(e)||0}function W3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+Al(o)},0)}function SL(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=Al(c)}return n}function DL(e){var t=e.getBBox();return Dc(0,0,t.width,t.height)}function jL(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Gm;var i=Wr(e).getComputedStyle(e),s=SL(i),o=s.left+s.right,c=s.top+s.bottom,u=Al(i.width),f=Al(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=W3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=W3(i,"top","bottom")+c)),!AL(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return Dc(s.left,s.top,u,f)}var OL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Wr(e).SVGGraphicsElement}:function(e){return e instanceof Wr(e).SVGElement&&typeof e.getBBox=="function"}}();function AL(e){return e===Wr(e).document.documentElement}function EL(e){return $d?OL(e)?DL(e):jL(e):Gm}function PL(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return $m(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function Dc(e,t,n,i){return{x:e,y:t,width:n,height:i}}var zL=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dc(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=EL(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),VL=function(){function e(t,n){var i=PL(n);$m(this,{target:t,contentRect:i})}return e}(),RL=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new Fm,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Wr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new zL(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Wr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new VL(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Zm=typeof WeakMap<"u"?new WeakMap:new Fm,Ym=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=kL.getInstance(),i=new RL(t,n,this);Zm.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Ym.prototype[e]=function(){var t;return(t=Zm.get(this))[e].apply(t,arguments)}});var JL=function(){return typeof Ol.ResizeObserver<"u"?Ol.ResizeObserver:Ym}();const Rt=(e,t,n)=>{if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},hd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],QL=e=>Um(e,"auto"),Um=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},_L=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>nL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ds=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],gd=(e,t,n=Cr,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:v=void 0}=h;if(v===void 0)return m<Cr?Cr:m;let y=m;return/^\d+\.?\d*$/.test(`${v}`)&&(y=Number(v)),/^\d+\.?\d*%$/.test(`${v}`)&&(y=Number(v)*o/100),/^\d+\.?\d*px$/i.test(`${v}`)&&(y=Number(`${v}`.replace(/px/i,""))),y},d=(h,m,v=!0)=>{const y=f(h,m),C=m<y?y:m;Object.assign(h,{calcWidth:C}),v&&(c=c-C,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const y=String(Ds(h,["resizeWidth","width"]));let C=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const b=Number(y.replace("px",""));d(h,b),C=!1}if(/^\d+\.?\d*%$/.test(y)){let b=n;if(c>0){const T=Number(y.replace("%",""));b=c*T/100}d(h,b),C=!1}C&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,v)=>{h=c/(u.length-v),d(t[m],h,!1);const{calcWidth:y}=t[m];c=c-y}):u.forEach(m=>{const v=f(t[m],Cr);Object.assign(t[m],{calcWidth:v})})}},Km=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?st.debounce(o,n):st.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new JL(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},Gd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},El=(e,t,n)=>n.type==="index"?e[$e.ROW_INDEX]+1:st.get(e,t),Ns=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ns(Reflect.apply(e,globalThis,t),t):[],Xm=(e,t,n)=>{const i=qm(e,t,n);return i!==null?i:Vi.v4()},qm=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===$e.ROW_INDEX?`__ROW_INDEX_${n}`:st.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,WL=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},e1=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),H3=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,t1=(e,t,n,i)=>{const s=H3(e,t,n,i,"colspan"),o=H3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},n1=(e,t)=>{var c,u;const n=e.field,i=f=>El(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Et.NULL?()=>!0:(f,d)=>o(f,d)*(t===Et.DESC?-1:1)},i1=e=>{const t={[Et.NULL]:0,[Et.ASC]:1,[Et.DESC]:2};return e===void 0?Et.NULL:Object.keys(t)[(t[e]+1)%3]},a1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Et.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},yl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,HL=(e,t,n)=>{if(e[$e.ROW_UID]!==void 0)return e[$e.ROW_UID];const i=Xm(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},js=e=>a.unref(e[$e.ROW_SOURCE_DATA]||e),r1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),B3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:gh})]).def(void 0),title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ze("ResizerWay",{default:Hm.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{let h=!0,{resizerWay:m}=e,v=n.value.innerText,y="auto",C=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",v=c.content||n.value.innerText,typeof c.content=="function"&&(v=c.content(e.column,e.row)),C=c.watchCellResize,y=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:v,mode:y,resizerWay:m,watchCellResize:C}},d=()=>{if(!n.value||!Va(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=Fb(n.value)),h==="static"&&(i.value=!0),i.value){const v=a.ref(f());u===null&&(u=dh(n.value,{disabled:v.value.disabled,content:v.value.content,mode:v.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:v}=f();if(!h&&(d(),v!==!1&&e.observerResize)){let y=Km(n.value,()=>{d()},60,!0,m);y.start(),a.onBeforeUnmount(()=>{y.disconnect(),y=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),md=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class BL{constructor(t,n){ke(this,"props",null);ke(this,"ctx",null);this.props=t,this.ctx=n}}const FL=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ht("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Tc,{scene:"part",type:i.value,description:n.value},null)}}),$L=a.defineComponent({name:"HeadFilter",props:{column:p.any.def({}),height:p.number.def(Pa)},emits:["change","filterSave"],setup(e,{emit:t}){var P;const{resolveClassName:n}=ye(),i=ht("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((P=o.value)==null?void 0:P.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Ee({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Ee({[n("table-head-filter")]:!0}),h=a.ref(null),m=O=>{u.isOpen=O,O&&setTimeout(()=>{h.value.reset()})},v=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:O=[]}=o.value;return O}),C=(O,R="ig")=>new RegExp(`${O}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),b=(O,R)=>{const{match:J}=o.value,G=El(R,Rt(s,"field",[s,R]),s);return J==="full"&&O.includes(G),O.some(ie=>C(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(O,R,J,G)=>o.value.filterFn(O,R,e.column,J,G):(O,R)=>O.length?b(O,R):!0,N=()=>{k(!0),t("filterSave",[...u.checked]),u.isOpen=!1},k=(O=!1)=>{const{disabled:R}=I(x,i.value.confirm);if(R||O){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(O,R)=>({disabled:O==="disabled"||O===!1,text:typeof O=="string"?O:R}),{btnSave:x,btnReset:L}=o.value,_=()=>{const{disabled:O,text:R}=I(x,i.value.confirm);return O?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},S=()=>{const{disabled:O,text:R}=I(L,i.value.reset);return O?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(O,R)=>{const J=new Set(u.checked);O?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),k()},E=O=>O.data.length?O.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode(Xn,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Kt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:Yl.SHOWN,arrow:!1,offset:0},{theme:v},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(gc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Lc,{class:"content-list"},{default:()=>[a.createVNode(Gr,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:E})]}),a.createVNode("div",{class:"content-footer"},[_(),a.createVNode("span",{class:"btn-filter-split"},null),S()])])})}}),GL=a.defineComponent({name:"HeadSort",props:{column:p.any.def({}),defaultSort:p.oneOf(sL).def(Et.NULL),active:p.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=ye(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Et.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Et.NULL&&(h=i1(d)),s.value===d&&(h=Et.NULL);const m=n1(e.column,h),v=a1(e.column.sort);if((v==null?void 0:v.value)==="custom"){t("change",(v==null?void 0:v.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Et.NULL)},[a.createVNode(ec,{class:["sort-action","sort-asc",e.active&&s.value===Et.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Et.ASC)},null),a.createVNode(Us,{class:["sort-action","sort-desc",e.active&&s.value===Et.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Et.DESC)},null)])}});function F3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const ZL=a.defineComponent({name:"Settings",props:{settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:Wm.def(_m.SMALL),sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),columns:p.array.def([]),rowHeight:p.number.def(Pa)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=ht("table"),s=aL(i),o=(J,G)=>Rt(J,["field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),y=`light ${n("table-settings")}`,C=a.computed(()=>f.value.fields||e.columns||[]),b={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(b,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(C)}),u.value=!1},N=()=>{c.value=b.checkAll,d.value=b.activeSize,h.value=b.activeHeight,m.value=b.checkedFields,u.value=!1},k=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((ge,ue)=>ge.disabled&&m.value.includes(o(ge,ue))).map((ge,ue)=>o(ge,ue));if(c.value){const ge=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...ge,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),x=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),_=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),S=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),E={marginRight:"12px"},P=()=>x.map(J=>a.createVNode("span",{class:D(J),onClick:()=>S(J)},[J.label])),O=a.computed(()=>m.value.length>0&&!C.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&C.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Kt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:y}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:k},[a.createVNode(rc,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(Xs,{class:"icon-close-action",onClick:N},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode(Xn,{label:i.value.setting.fields.selectAll,indeterminate:!!O.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Lc,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},F3(J=C.value.map((G,ie)=>{let ge;return a.createVNode("div",{class:"field-item"},[a.createVNode(Xn,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:_(G,ie)},F3(ge=Rt(G,"label",[G,ie]))?ge:{default:()=>[ge]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),P()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(Pt,{theme:"primary",style:E,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(Pt,{style:E,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Zd=(e,t,n)=>{const i=(v,y,C)=>({column_fixed:!!v.fixed,column_fixed_left:v.fixed!=="right",column_fixed_right:v.fixed==="right",shadow:v.fixed==="right"?C-y>2:y>0}),s=v=>v.fixed==="right"?"right":"left",o={left:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed&&y.fixed!=="right").reduce((y,C,b)=>v&&b===0?y:y+Ds(C),0),right:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>v&&b===0?y:y+Ds(C),n?_r:0)},c=(v,y,C=0)=>{const b=y[Kn.COL_UID],T=v==="right"?-1:1,N=t.filter(x=>!x.isHidden),{length:k}=N;let w=v==="right"?k*T:1,I=0;for(w;;){w=w+-1*T;const x=Math.abs(w),L=N[x],_=s(L),S=L[Kn.COL_UID];if(_===v&&b!==S){const D=Ds(L);I=I+D}if(b===S)break}return I+C},u=(v,y=!1)=>{if(!v.fixed||v.isHidden)return{};const C={left:0,right:y?_r:-1},b=s(v);return C[b]=c(b,v,C[b]),{[b]:`${C[b]}px`}},f=v=>({width:`${o[v](!1)}px`,bottom:"0px"}),d=a.computed(()=>{const v={left:!1,right:!1};return t.filter(y=>!y.isHidden&&y.fixed).map(y=>{const C=s(y),b=v[C];return v[C]=!0,{isExist:b,colPos:C,column:y}})}),{resolveClassName:h}=ye();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function $3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class YL{constructor(t,n,i,s,o,c){ke(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});ke(this,"getColumnClass",(t,n)=>({[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"}));ke(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new BL(t,n),this.uuid=Vi.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=Gd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=e1(u,d,s)}),this.emitEvent(Rn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(ZL,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(FL,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(mh,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(jt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(jt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(jt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=i1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=n1(n,s);this.activeSortIndex.value=t,this.emitEvent(Rn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Rn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(GL,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Rn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(jt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode($L,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=Gd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const b=this.reactiveProp.rowActions.get($e.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[$e.ROW_SELECTION]:!!b},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const v=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[v]));const y=typeof v=="string"?v:void 0,C={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(B3,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},$3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const v=m.split("_").slice(-1)[0];return Object.assign(h,{[v]:y=>{d.listeners.get(m).forEach(C=>Reflect.apply(C,this,[y,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Zd(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${_r+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(md,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:u(d,this.styleRef.value.hasScrollY),onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=Zd(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ns(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ns(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`];return[a.createVNode(md,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:qm(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var k;const h=[n(f),...Ns(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:v,rowspan:y}=t1(f,d,s,o),C=$e.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((k=s[C])==null?void 0:k[b])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ns(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[$e.ROW_EXPAND],"is-last":o+y>=i}],x=(L,_)=>{const S={event:L,row:js(s),column:r1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(_,S)};return a.createVNode("td",{class:I,style:h,colspan:v,rowspan:y,onClick:L=>x(L,jt.CELL_CLICK),onDblclick:L=>x(L,jt.CELL_DBL_CLICK)},[a.createVNode(B3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},$3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[$e.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${HL(t,i,this.props)}_expand`;return a.createVNode(md,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,js(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(jt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(jt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(jt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(jt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[$e.ROW_EXPAND]?a.createVNode(qs,null,null):a.createVNode(io,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Rn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=El(t,Rt(n,"field",[n,t]),n),c=t[$e.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Rn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get($e.ROW_SELECTION_INDETERMINATE),c=yl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(Xn,{onChange:s,disabled:!c,modelValue:t[$e.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=El(t,Rt(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Ee({active:this.isColActive(n)}),s=`${QL(Ds(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const jc=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),G3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:hd(e.activeColumn):Array.isArray(e.activeColumn)?hd(e.activeColumn[0]):hd(e.activeColumn):[],UL=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=jc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(G3(e)),o=()=>i().map((c,u)=>({index:u,active:s.some(f=>f===u),_column:c}));return a.watchEffect(()=>{n=o();const c=G3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},KL=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const x=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+x,_=Number(f.minWidth);f.resizeWidth=L>_?L:_,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",y),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},v=w=>st.throttle(()=>{const I=w.clientX-u,x=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<x&&(h.value=w.clientX-u+d)},60),y=w=>{document.body.style.setProperty("cursor",""),v(w)()},C={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const x=w.target.closest("th");if(c&&x.style.setProperty("user-select","none"),!c){if(!x)return;const L=x.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,x.style.setProperty("cursor","col-resize")):(x.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const x=w.target;c||x.style.setProperty("cursor","")}},b=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(C).forEach(I=>{const x=b(I);w.listeners.has(x)||w.listeners.set(x,[]),w.listeners.get(x).push(C[I])})})},N=()=>{e.forEach(w=>{Object.keys(C).forEach(I=>{const x=b(I);if(w.listeners.has(x)){const L=w.listeners.get(x);L.length=0}})})};t&&T();const k=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:k}},XL=(e,t,n,i,s)=>{const{getColumns:o}=jc(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Ee({[Gt("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},_L(e.border))),m=Ee({[Gt("table-head")]:!0,"has-settings":!!e.settings}),v=a.computed(()=>o()),y=Gd(e),C=a.computed(()=>({"--row-height":`${Rt(y,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),b={[Gt("table-body")]:!0},T=a.computed(()=>Ee({[Gt("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),N=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",k=()=>{if(v.value.every(P=>/^\d+\.?\d*(px)?$/ig.test(`${P.width}`))){const P=v.value.reduce((R,J)=>R+Number(`${J.width}`.replace(/px/ig,"")),0),O=u.value?_r:0;return`${P+O}px`}return"100%"},w=a.computed(()=>({minHeight:Um(e.minHeight,"auto"),width:k(),maxWidth:"100%",height:N()})),I=(P,O)=>{const R=String(P);if(/^\d+\.?\d*$/.test(R))return Number(R);if(/^\d+\.?\d*px$/ig.test(R))return Number(R.replace("px",""));if(/^\d+\.?\d*%$/ig.test(R)&&typeof O=="number"){const J=Number(R.replace("%",""));return O*J/100}return O},x=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),L=()=>e.showHead?I(e.headHeight,Pa):0,_=()=>{const P=I(e.height,c.value),O=L(),R=I(e.minHeight,c.value),J=e.pagination&&e.data.length?e.paginationHeight:0,G=P-O-J,ie=e.height!=="auto"?`${G}px`:!1,ge=R-O-J,ue=I(e.maxHeight,void 0),ae=typeof ue=="number"?`${ue-O-J}px`:!1;Object.assign(x,{display:s!=null&&s.length?"block":!1,"min-height":`${ge}px`,height:ie,maxHeight:ae})};a.onMounted(()=>{S(n==null?void 0:n.value)});const S=P=>{if(P){const{height:O}=P.parentElement.getBoundingClientRect();c.value=O,_(),D(P)}},D=P=>{if(!P)return;const O=e.virtualEnabled?`.${Gt("virtual-section")}`:`.${Gt("table-body-content")}`,R=P.querySelector(`.${Gt("table-body")}`);u.value=WL(R,O,0)};return{tableClass:h,headClass:m,contentClass:b,footerClass:T,wrapperStyle:w,contentStyle:x,headStyle:C,resetTableHeight:S,updateBorderClass:D,getColumnsWidthOffsetWidth:()=>{let P=0;return u.value&&(P=P+_r),e.border.includes(jl.OUTER)&&!e.border.includes(jl.NONE)&&(P=P+2),P},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},qL=(e,t)=>{var te,oe;const n=a.reactive([]),{getColumns:i}=jc(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let Q=Cr;return W.sort&&(Q=Q+18),W.filter&&(Q=Q+28),Q},o=a.computed(()=>i()),c=W=>{var ee,fe;const Q=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:e1($,K,Q),[Kn.COL_UID]:Vi.v4(),[Kn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=KL(n,!0),{activeColumns:m}=UL(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const v=st.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{v()},{immediate:!0,deep:!0});const y=e.columns.reduce((W,Q,$)=>{const ee=Rt(Q,["field","type"],[Q,$]),fe=a1(Q.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),C=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(te=e.settings)==null?void 0:te.size,height:vl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:y||e.defaultSort}),b=W=>{var Q;return C.rowActions.has(W)?(Q=C.rowActions.get(W))==null?void 0:Q.isExpand:!1},T=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(W,Q=void 0)=>{const $=W[$e.ROW_UID],ee=typeof Q=="boolean"?Q:!b($);C.rowActions.set($,Object.assign({},C.rowActions.get($)??{},{isExpand:ee})),ae()},k=()=>C.rowActions.has($e.ROW_SELECTION_ALL)?C.rowActions.get($e.ROW_SELECTION_ALL):e.selectionKey?O.every(W=>E(W)):!1,w=W=>{const Q=W[$e.ROW_UID],{isSelected:$=!1}=C.rowActions.get(Q)||{};return $},I=(W=w)=>{let Q=!1,$=!1;O.forEach(ee=>{const fe=W(ee);!Q&&!fe&&(Q=!0),!$&&fe&&($=!0)}),C.rowActions.set($e.ROW_SELECTION_INDETERMINATE,$&&Q),C.rowActions.set($e.ROW_SELECTION_ALL,$&&!Q)},x=()=>e.columns.some(W=>W.type==="selection"),L=()=>{x()&&I(W=>E(W))},_=(W=void 0)=>{const Q=typeof W=="boolean"?W:!k();C.rowActions.set($e.ROW_SELECTION_ALL,Q),C.rowActions.set($e.ROW_SELECTION_INDETERMINATE,!1),O.forEach(($,ee)=>{if(yl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[$e.ROW_UID],K=Object.assign({},C.rowActions.get(fe)??{},{isSelected:Q});C.rowActions.set(fe,K)}}),I(),ae(Q),Z(null,W,!0)},S=()=>{_(!1)},D=(W,Q)=>{const $=W[$e.ROW_UID];if($){const ee=typeof Q=="boolean"?Q:!P(W,$),fe=Object.assign({},C.rowActions.get($)??{},{isSelected:ee});C.rowActions.set($,fe),Q||C.rowActions.set($e.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,Q,!1)}},E=(W,Q=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?st.get(W,e.selectionKey):Q(W),P=(W,Q,$)=>E(W,()=>{var fe;const ee=Q===void 0?W[$e.ROW_UID]:Q;return yl(e,{row:W,index:$,isCheckAll:!1})&&k()?!0:C.rowActions.has(ee)?(fe=C.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),O=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),ge=(W=!1)=>{let Q=null;const $={},ee=e.data.map(fe=>({[$e.ROW_UID]:Vi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const be=Xm(K,e,de);Q=be;const Ie={...K,[$e.ROW_UID]:K[$e.ROW_UID]||be,[$e.ROW_SOURCE_DATA]:{...K}};if(R.value){const Se=me(K,be,de,$,Q);Object.assign(Ie,{[$e.ROW_SKIP_CFG]:Se})}return J.value&&Object.assign(Ie,{[$e.ROW_SELECTION]:P(K,be,de)}),ie.value&&Object.assign(Ie,{[$e.ROW_INDEX]:de}),G.value&&Object.assign(Ie,{[$e.ROW_EXPAND]:W?b(be):!1}),Ie});O.length=0,O.push(...fe),J.value&&L();return}O.length=0,O.push(...ee)},ue=(W,Q,$,ee)=>{const fe=P($,$[$e.ROW_UID],ee);return W&&typeof Q=="boolean"?Q:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let Q=null;const $={};O.forEach((ee,fe)=>{const K=ee[$e.ROW_UID];if(G.value&&Object.assign(ee,{[$e.ROW_EXPAND]:b(ee[$e.ROW_UID])}),R.value){const de=me(ee,K,fe,$,Q);Q=ee[$e.ROW_UID],Object.assign(ee,{[$e.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[$e.ROW_INDEX]:fe}),J.value){const de=yl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[$e.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},me=(W,Q,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[Q]||(ee[Q]={}),n.forEach((be,Ie)=>{var Le;const{colspan:Se,rowspan:Ve}=t1(be,Ie,W,$),Pe=be[Kn.COL_UID],ce=((Le=de[Pe])==null?void 0:Le.skipRowLen)??0,Ce={[Pe]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(Ce[Pe].skipColLen=K,Ce[Pe].skipCol=!0,K=K-1),ce>1?(Ce[Pe].skipRowLen=ce-1,Ce[Pe].skipRow=!0):Ve>1&&(Ce[Pe].skipRowLen=Ve,Ce[Pe].skipRow=!1),Se>1&&(Ce[Pe].skipColLen=Se,K=Se-1),Object.assign(ee[Q],{...Ce})}),ee[Q]},B=st.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,Q,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{st.has(ee,e.selectionKey)&&st.set(ee,e.selectionKey,!!Q)});else if(st.has(W,e.selectionKey)){const ee=e.data.find(fe=>st.get(fe,e.rowKey)===st.get(W,e.rowKey));st.set(ee,e.selectionKey,!!Q)}}},{fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,fixedWrapperClass:X}=Zd(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:O,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,initIndexData:ge,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:S,toggleAllSelection:_,toggleRowSelection:D,getSelection:()=>O.filter(W=>P(W)),clearSort:T}},eT=a.defineComponent({name:"Table",props:uL,emits:iL,setup(e,t){const n=ht("table");let i=null,s=null,o=null;const c=new fL,u=a.reactive([]),{initColumns:f}=jc(e,u);a.provide(Rm,f),a.provide(Jm,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:v,dragOffsetXStyle:y,dragOffsetX:C,reactiveSchema:b,indexData:T,fixedColumns:N,resolveColumnStyle:k,resolveColumnClass:w,setRowExpand:I,initIndexData:x,fixedWrapperClass:L,clearSelection:_,toggleAllSelection:S,toggleRowSelection:D,getSelection:E,clearSort:P,updateColGroups:O}=qL(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=hL(e,T),{tableClass:ge,headClass:ue,contentClass:ae,footerClass:me,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:V,updateBorderClass:Y,resetTableHeight:X,getColumnsWidthOffsetWidth:re,hasFooter:te}=XL(e,u,d,b,R),{resolveClassName:oe}=ye(),W=a.computed(()=>({hasScrollY:V.value})),Q=new YL(e,t,b,v,W,n),$=()=>{const He=d.value.querySelector(`.${oe("table-body-content")}`),Ae=He.querySelector("table");if(Ae){const Be=Ae.scrollWidth,ot=He.clientWidth;m.value=Be-ot}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{x(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{X(d.value),Y(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const He=re();gd(d.value,v,20,He),$()}}),Q.on(Rn.ON_SORT_BY_CLICK,He=>{const{sortFn:Ae,column:Be,index:ot,type:qe}=He;typeof Ae=="function"&&(i=Ae,s=Be,Object.assign(s,{[Kn.SORT_TYPE]:qe}),G(o,i,s)),t.emit(jt.COLUMN_SORT,{column:a.unref(Be[Kn.COL_SOURCE_DATA]),index:ot,type:qe})}).on(Rn.ON_FILTER_CLICK,He=>{const{filterFn:Ae,checked:Be,column:ot,index:qe}=He;typeof Ae=="function"&&(o=Ae,G(o,i,s)),t.emit(jt.COLUMN_FILTER,{checked:Be,column:a.unref(ot[Kn.COL_SOURCE_DATA]),index:qe})}).on(Rn.ON_SETTING_CHANGE,He=>{const{checked:Ae=[],size:Be,height:ot,fields:qe}=He;a.nextTick(()=>{O({checked:Ae,fields:qe}),Y(d.value);const mt=re();Ae.length&&gd(d.value,v,Cr,mt),t.emit(jt.SETTING_CHANGE,{checked:Ae,size:Be,height:ot,fields:qe})})}).on(Rn.ON_ROW_EXPAND_CLICK,He=>{const{row:Ae,column:Be,index:ot,rows:qe,e:mt}=He;t.emit(jt.ROW_EXPAND_CLICK,{row:js(Ae),column:r1(Be),index:ot,rows:qe,e:mt}),I(Ae,!Ae[$e.ROW_EXPAND])}).on(Rn.ON_ROW_CHECK,({row:He,isAll:Ae,index:Be,value:ot})=>{Ae?(S(ot),t.emit(jt.ROW_SELECT_ALL,{checked:ot,data:e.data})):(D(He,ot),t.emit(jt.ROW_SELECT,{row:js(He),index:Be,checked:ot,data:e.data})),t.emit(jt.ROW_SELECT_CHANGE,{row:js(He),isAll:Ae,index:Be,checked:ot,data:e.data})});const ee=He=>{const Ae=b.pos.bottom??0,Be=He[1],{translateX:ot,translateY:qe,pos:mt={}}=Be;b.scrollTranslateY=qe,b.scrollTranslateX=ot,b.pos=mt;const{bottom:Ze}=mt;Ze<=2&&Ae>Ze&&Zs(60,()=>{t.emit(jt.SCROLL_BOTTOM,{...mt,translateX:ot,translateY:qe})},!0)(),$()},fe=(He={left:0,top:0})=>{var Ae,Be;(Be=(Ae=h.value)==null?void 0:Ae.scrollTo)==null||Be.call(Ae,He)};a.onMounted(()=>{if(e.observerResize){let He=Km(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&X(d.value),Y(d.value);const Ae=re();gd(d.value,v,20,Ae)},180,!0,e.resizerWay);He.start(),a.onBeforeUnmount(()=>{He.disconnect(),He=null})}}),a.onBeforeUnmount(()=>{Q.destroy()});const K=()=>d.value;t.expose({setRowExpand:I,clearSelection:_,toggleAllSelection:S,toggleRowSelection:D,getSelection:E,clearSort:P,scrollTo:fe,getRoot:K});const de=a.computed(()=>({...ae,"__is-empty":!R.length})),be=a.computed(()=>({[oe("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled})),Ie={column_drag_line:!0,"offset-x":!0},Se=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),Ve={"scroll-loading":!0,_bottom:!0},Pe=a.computed(()=>({[oe("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),ce={zIndex:-1,width:0,height:0,display:"none"},Ce=a.computed(()=>({"--footer-height":te.value?`${e.paginationHeight}px`:"0"})),Le=a.computed(()=>({right:V.value?`${_r}px`:0,...Ce.value})),{renderScrollLoading:Re}=gL(e,t),at=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),nt=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ct=()=>t.slots.prepend?a.createVNode("div",{style:nt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var He,Ae;return a.createVNode("div",{class:ge.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[Q.renderTableHeadSchema()]),a.createVNode(Gr,a.mergeProps({ref:h,lineHeight:Q.getRowHeight,class:de.value,style:Z,list:R},at.value,{contentClassName:be.value,onContentScroll:ee,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ct(),default:Be=>Q.renderTableBodySchema(Be.data||R),afterSection:()=>a.createVNode("div",{class:Pe.value},null)}),a.createVNode("div",{class:L,style:Le.value},[N.value.map(({isExist:Be,colPos:ot,column:qe})=>Be?"":a.createVNode("div",{class:w(qe,b.scrollTranslateX,m.value),style:k(ot)},null)),a.createVNode("div",{class:Ie,style:Se.value},null),a.createVNode("div",{class:Ve},[Re()])]),a.createVNode("div",{class:me.value,style:Ce.value},[te.value&&Q.renderTableFooter(J.value)]),a.createVNode("div",{style:ce},[(Ae=(He=t.slots).default)==null?void 0:Ae.call(He)])])}}}),s1=Xt(eT,{Column:dL}),gr=12;function tT(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function nT(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const Z3=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},o1=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},Y3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.string,tpl:{type:Function}},render(){const{resolveClassName:e}=ye(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),iT=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:ze("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),aT=a.defineComponent({name:"TagRender",directives:{bkTooltips:$r},props:{node:p.object,displayKey:p.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=Yb(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),rT=a.defineComponent({name:"TagInput",directives:{bkTooltips:$r},props:iT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ht("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=ye(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=tT(u),m=a.ref(""),v=a.ref(null),y=a.ref(null),C=a.ref(null),b=a.ref(null),T=a.ref(null),N=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>S.selectedTagList.length===0&&m.value===""&&!s.isEdit),x=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&S.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),_=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),S=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>S.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:E,saveKeyMap:P}=nT(e),O=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((Ce,Le)=>{Ce.__index__=Le,ce[Ce.group.groupId]||(ce[Ce.group.groupId]={id:Ce.group.groupId,name:Ce.group.groupName,children:[]}),ce[Ce.group.groupId].children.push(Ce)}),Object.keys(ce).map(Ce=>ce[Ce])}return f.curPageList});a.watch([()=>E.value],()=>{a.nextTick(()=>{ge()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var Ce;me(D.value,ce)||(a.nextTick(()=>{ge()}),e.withValidate&&((Ce=n==null?void 0:n.validate)==null||Ce.call(n,"change")))}),a.watch(m,st.debounce(()=>{const ce=f.curPageList.length!==0,{value:Ce}=m;Ce!==""&&ce||Ce===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{ge()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=b.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:Ce,scrollHeight:Le}=T.value;if(ce+Ce>=Le){const Re=f.curPage+1;Re<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Re)},500))}},G=()=>{var Ce;return Array.from(((Ce=C.value)==null?void 0:Ce.childNodes)||[]).filter(Le=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Le.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:Ce}=ce.target;(Ce.indexOf(`${c("tag-input-trigger")}`)>-1||Ce.indexOf("tag-list")>-1)&&C.value.appendChild(b.value)}clearTimeout(N.value),w.value&&D.value.length&&(S.tagListCache=[...D.value],S.selectedTagListCache=[...S.selectedTagList],m.value=S.selectedTagListCache[0][e.saveKey],Se(S.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var Ce;(Ce=v.value)==null||Ce.focus(),e.trigger==="focus"&&S.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},ge=()=>{const{saveKey:ce,modelValue:Ce,displayKey:Le,allowCreate:Re,trigger:at,isAsyncList:nt}=e;if(S.selectedTagList=[],S.localList=E.value,Ce.length){const ct={};S.selectedTagList=Ce.map(He=>{const Ae=P.value[He];return ct[He]=1,!Ae&&Re?{[ce]:He,[Le]:He}:Ae}).filter(He=>He),w.value||(S.localList=S.localList.filter(He=>!ct[He[ce]]))}if(nt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}at==="focus"&&ue()},ue=(ce="")=>{const{searchKey:Ce,filterCallback:Le}=e,Re=ce.toLowerCase().trim();if(Re===""){d(S.localList);return}let at=[];typeof Le=="function"?at=Le(Re,Ce,S.localList)||[]:Array.isArray(Ce)?at=S.localList.filter(nt=>Ce.some(ct=>nt[ct].toLowerCase().indexOf(Re)>-1)):at=S.localList.filter(nt=>nt[Ce].toLowerCase().indexOf(Re)>-1),d(at)},ae=(ce,Ce)=>{const Le={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Le[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Le[`${c("selector-actived")}`]=Ce===s.focusItemIndex,Le};function me(ce,Ce){return ce.length!==Ce.length?!1:Ce.every((Le,Re)=>ce[Re]===Le)}const B=()=>{S.tagListCache=[],S.selectedTagListCache=[],S.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const Ce=G().findIndex(({id:Le})=>Le==="tagInputItem");return Ce>=0?Ce:0},V=(ce,Ce,Le=!1)=>{if(!Ce||!ce)return;let Re=Ce;Le&&(Re=Ce.nextElementSibling||null),Ce.parentNode.insertBefore(ce,Re)},Y=ce=>{const{maxData:Ce,trigger:Le,allowCreate:Re}=e;if(Ce===-1||Ce>D.value.length){const{value:at}=ce!=null&&ce.target?ce.target:m,nt=Z3(at);nt?(ue(at),v.value.style.width=`${nt*gr}px`):Le==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Re?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=y.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var Ce;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Le]=S.tagListCache;ce&&ce===Le&&S.selectedTagListCache.length?Ie(S.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Le=f.curPageList.find(Re=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>Re[nt]).includes(ce):Re[e.searchKey]===ce);Le?te(Le,"select"):e.allowCreate&&te(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(Ce=n==null?void 0:n.validate)==null||Ce.call(n,"blur")},200)},te=(ce,Ce,Le)=>{Le==null||Le.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Ie(ce,Ce),W("select"),Z(),o.isShow=!1)},oe=(ce,Ce,Le)=>{Le==null||Le.stopPropagation(),Se(ce,Ce),Z(),W("remove",ce),v.value.style.width=`${gr}px`},W=(ce,Ce)=>{t(ce,Ce),t("update:modelValue",D.value),t("change",D.value)},Q=ce=>{ce.stopPropagation();const Ce=S.selectedTagList;S.selectedTagList=[];const Le=Ce.filter(Re=>P.value[Re[e.saveKey]]);(e.allowCreate&&Le.length!==0||!e.allowCreate)&&!w.value&&S.localList.push(...Le),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const Ce=T.value.querySelector(`.${c("selector-actived")}`);if(!Ce)return;const Le={height:Ce.clientHeight,yAxis:Ce.getBoundingClientRect().y};Le.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Le.yAxis));const Re=Le.yAxis+Le.height-ce.yAxis;Re>ce.height&&(T.value.scrollTop=T.value.scrollTop+Re-ce.height)})},ee=(ce,Ce)=>{const Le=G();V(b.value,Le[ce-1]),S.selectedTagList.splice(ce-1,1),ie();const Re=P.value[Ce[e.saveKey]];(e.allowCreate&&Re||!e.allowCreate)&&!w.value&&S.localList.push(Ce),v.value=`${gr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let Ce;const Le=ce.target.value,Re=Z3(Le),at=H(),nt=G();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),$();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),$();break;case"ArrowLeft":if(s.isEdit=!0,!Re){if(at<1)return;V(b.value,nt[at-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Re){if(at===nt.length-1)return;V(nt[at+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?te(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&te(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":at!==0&&!m.value&&(Ce=S.selectedTagList[at-1],ee(at,Ce));break}},K=ce=>{const Ce=[],Le=ce.split(";"),Re=/^[a-zA-Z][a-zA-Z_]*/g;return Le.forEach(at=>{const nt=at.match(Re);if(nt){const ct=nt.join("");Ce.push({[e.saveKey]:ct,[e.displayKey]:ct})}}),Ce},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:Ce,saveKey:Le,displayKey:Re,pasteFn:at,allowCreate:nt}=e,ct=ce.clipboardData.getData("text");let Ae=(at?at(ct):K(ct)).map(Be=>Be[Le]);if(Ae.length){const Be=G(),ot=H(),qe=S.localList.map(Ze=>Ze[Le]);if(Ae=Ae.filter(Ze=>{const Qt=(Ze==null?void 0:Ze.trim())&&!D.value.includes(Ze);return nt?Qt:Qt&&qe.includes(Ze)}),Ce!==-1){const Ze=S.selectedTagList.length;if(Ze<Ce){const Qt=Ce-Ze;Ae.length>Qt&&(Ae=[...Ae.slice(0,Qt)])}else Ae=[]}const mt=nt?Ae.map(Ze=>S.localList.find(Hi=>Hi[Le]===Ze)??{[Le]:Ze,[Re]:Ze}):S.localList.filter(Ze=>Ae.includes(Ze[Le]));Ae.length&&(S.selectedTagList.splice(ot,0,...mt),V(b.value,Be[ot]),v.value.style.width=`${gr}px`,S.localList=S.localList.filter(Ze=>!Ae.includes(Ze[Le])),W("select"),ie())}},be=ce=>{e.disabled||(V(b.value,ce.currentTarget,!0),v.value.style.width=`${gr}px`,o.isShow&&R())},Ie=(ce,Ce)=>{if(S.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Le,saveKey:Re,displayKey:at,createTagValidator:nt}=e,ct=H();let He=1,Ae=!1,Be;const ot=qe=>typeof nt=="function"?nt(qe):!0;if(Ce==="custom")if(Le){let qe=ce.split(Le);qe=qe.filter(Ze=>(Ze==null?void 0:Ze.trim())&&!D.value.includes(Ze)&&ot(Ze));const mt=qe.map(Ze=>P.value[Ze]||{[Re]:Ze,[at]:Ze});qe.length&&(S.selectedTagList.splice(ct,0,...mt),He=mt.length,Ae=!0)}else{const qe=typeof ce=="object";if(Be=qe?ce[Re]:ce.trim(),Be=Be.replace(/\s+/g,""),Be!==void 0&&!D.value.includes(Be)&&ot(Be)){const mt=P.value[Be]||(qe?ce:{[Re]:Be,[at]:Be});S.selectedTagList.splice(ct,0,mt),Ae=!0}}else ce&&(Be=ce[Re],Be!==void 0&&!D.value.includes(Be)&&(S.selectedTagList.splice(ct,0,ce),Ae=!0));Ae&&a.nextTick(()=>{for(let qe=1;qe<=He;qe++){const Ze=G()[ct+qe];V(Ze,b.value)}if(v.value.style.width=`${gr}px`,!w.value){e.allowNextFocus&&ie();const qe=D.value.reduce((mt,Ze)=>(mt[Ze]=1,mt),{});S.localList=S.localList.filter(mt=>!qe[mt[Re]])}})},Se=(ce,Ce)=>{S.selectedTagList.splice(Ce,1);const Le=P.value[ce[e.saveKey]];(e.allowCreate&&Le||!e.allowCreate)&&!w.value&&S.localList.push(ce)},Ve=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Pe}=o1(y,Ve,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(S),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:x,curInputValue:m,renderList:O,showTagClose:k,tagInputRef:v,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:T,triggerClass:_,overflowTagIndex:Pe,localCollapseTags:Ve,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:te,handleTagRemove:oe,handleClear:Q,tagFocus:be,handleKeydown:fe,handlePaste:de,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Kt,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(aT,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(mn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(pn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(Y3,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(Y3,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode(ca,{theme:"primary",size:Qa.Small},null)]):null])])})])}}),l1=Ue(rT),sT={direction:Ig(),align:Dd().def(Ll.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:Lg()},oT=a.defineComponent({name:"Divider",props:sT,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=ye();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}),c1=Ue(oT);var Pl=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Pl||{}),Os=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Os||{});const u1=ze("position",{}).def("top");var d1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(d1||{});const f1=ze("sortType",{}).def("replace"),lT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},cT={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:Mf(),panel:p.string||p.func},uT={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),tabPosition:u1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:f1,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},dT={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:u1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:f1,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...lT},U3=a.defineComponent({name:"TabNav",directives:{bkTooltips:$r},props:dT,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Os.LEFT,Os.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:v}=t.value,y={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${v}px`,background:e.activeBarColor};return e.tabPosition===Os.LEFT?y.right=0:y.left=0,y}if(e.type===Pl.UNBORDER_CARD){const{clientWidth:m,offsetLeft:v}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${v}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((v,y)=>{if(!v.props)return null;const{name:C,label:b,closable:T,visible:N,disabled:k,sortable:w,tips:I}=v.props;if(!N)return!1;e.active===C&&(m=!0);const x=L=>v.slots.label?a.h(v.slots.label):[void 0,""].includes(L)?`选项卡${y+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:C,closable:T,visible:N,disabled:k,sortable:w,tips:I,tabLabel:x(b)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=ye();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((b,T)=>{if(!b)return null;const{name:N,disabled:k,tabLabel:w}=b,I=()=>{const L=[this.resolveClassName("tab-header-item")];return k&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},x=(L,_)=>!k&&(L||_);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!k&&this.handleTabChange(N),draggable:x(b.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),x(b.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,b)},[a.createVNode(pn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:b.tips,disabled:!b.tips}]])}),m=()=>{var T,N;const b=[];return typeof this.$slots.add=="function"?b.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&b.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(no,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((k,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[k]))]):null},v=()=>this.type===Pl.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",y=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,C=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),C||y?"tab-header-auto":""]},[v(),h()]),C,y])}}),fT=a.defineComponent({name:"Tab",components:{TabNav:U3},props:uT,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:v}=h;return(v||[]).forEach(y=>{let{type:C}=y;C=C.name||C,C==="TabPanel"&&y.component?m.push(y.component):(C===a.Fragment||C==="template")&&c(y,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],v=c(m);v.length!==s.value.length&&(s.value=v)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,v){const y=s.value;if(v===d1.INSERT)if(h<m)y.splice(m+1,0,s[h]),y.splice(h,1);else if(h>m)y.splice(m,0,s[h]),y.splice(h+1,1);else return!1;else{const C=y[m];y[m]=y[h],y[h]=C}s.value=[...y],n("sort",h,m,v),n("sort-change",h,m,v)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=ye();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Os.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Pl.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:v,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:_}=this,S={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:v,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:_};return!s||!Array.isArray(s)?null:a.createVNode(U3,S,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),hT=a.defineComponent({name:"TabPanel",props:cT,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=ye();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}}),h1=Xt(fT,{TabPanel:hT}),ra={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let K3=1;const g1=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;ra[i].forEach(v=>{c+=(v.el.offsetHeight||0)+u}),K3+=1;const f=`message_${K3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=v=>{gT(v,i,u,s),a.render(null,d)},a.render(h,d),ra[i].push(h);let m;h.props.getContainer&&Va(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function gT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ra[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ra[t][o].el.offsetHeight,f=ra[t].length;for(let d=o;d<f;d++){const h=parseInt(ra[t][d].el.style[s],10)-u-n;ra[t][d].component.props.offsetY=h}ra[t].splice(o,1)}var m1={exports:{}};/*!
66
+ */function T7(e,t){if(!Tm.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i=typeof s[n]=="function"}return!i&&xm&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var x7=T7,k7=M7,S7=x7,A3=10,E3=40,P3=800;function km(e){var t=0,n=0,i=0,s=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),i=t*A3,s=n*A3,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=E3,s*=E3):(i*=P3,s*=P3)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}km.getEventType=function(){return k7.firefox()?"DOMMouseScroll":S7("wheel")?"wheel":"mousewheel"};var D7=km,j7=D7;const O7=Fs(j7),A7=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,E7=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(A7?"DOMMouseScroll":"mousewheel",function(n){const i=O7(n);t==null||t.apply(this,[n,i])})},P7={beforeMount(e,t){console.error(e,t),E7(e,t.value)}},ua=new Map,$r={beforeMount(e,t){const n=z3(t),{trigger:i}=n,s=V7(n);let o=null;if(i==="hover"){let c=null;e.addEventListener("mouseenter",()=>{o=setTimeout(()=>{Bd(e),clearTimeout(c),clearTimeout(o)},n.delay)}),s.addEventListener("mouseenter",()=>{clearTimeout(c)}),e.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{gs(e)},100)}),e.addEventListener("click",()=>{gs(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{gs(e)},100)})}else i==="click"&&document.body.addEventListener("click",c=>{e.contains(c.target)&&!s.hasAttribute("data-show")?o=setTimeout(()=>{Bd(e),clearTimeout(o)},n.delay):s.hasAttribute("data-show")&&gs(e)});ua.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){ua.get(e).opts=z3(t)},unmounted(e){gs(e),ua.delete(e)}};function z7(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function z3(e){const t=z7();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function V7(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=vi.getPopperIndex(),u=document.createElement("div");if(u.className=`${Gt("popper")} ${o?"light":"dark"} ${s}`,u.innerText=t,u.style.zIndex=String(c),n){const f=Sm();u.appendChild(f)}return u}function Sm(){const e=document.createElement("div");return e.className=Gt("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function R7(e,t){const{opts:n}=ua.get(e),{placement:i,distance:s,showOnInit:o}=n,c=dg(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&Bd(e),c}function Bd(e){const{popper:t,opts:n}=ua.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=Sm();t.appendChild(f)}document.body.appendChild(t);const u=R7(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),ua.get(e).popperInstance=u}function gs(e){if(!ua.get(e))return;const{popper:t,popperInstance:n,opts:i}=ua.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const V3=(e,t)=>{const n={content:"",target:e};return typeof t=="object"?Object.assign(n,t):n.content=t,n},dh=(e,t)=>{let n=null,i=null,s=null;const o=V3(e,t),{disabled:c}=o;if(c||n)return;const u=()=>{s&&clearTimeout(s),s=null},f=()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},d=()=>{i&&clearTimeout(i),i=setTimeout(()=>{const v=V3(e,t);v.isShow=!0,v.content=v.content||e.innerHTML,v.allowHtml=!0,Object.assign(v,{onContentMouseenter:u,onContentMouseleave:f}),n=uh(v)},100)},h=()=>{s=setTimeout(()=>{i&&clearTimeout(i),n==null||n.hide(),n==null||n.close(),n=null},120)};return e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",h),{destroyInstance:v=>{var y,C;h(),(y=v??e)==null||y.removeEventListener("mouseenter",d),(C=v??e)==null||C.removeEventListener("mouseleave",h)},instance:n}},J7={mounted(e,t){dh(e,t)}},Q7={onContentScroll:Function},_7={list:p.array.def([]),enabled:p.bool.def(!0),scrollEvent:p.bool.def(!1),lineHeight:p.oneOfType([p.number,p.func]).def(30),minHeight:p.number.def(30),height:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),width:p.oneOfType([p.string.def("100%"),p.number]).def("100%"),className:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentClassName:p.oneOfType([p.arrayOf(p.string),p.object,p.arrayOf(p.object),p.string]).def(""),contentStyle:p.object.def({}),scrollXName:p.string.def(Gt("F-scroll-x")),scrollYName:p.string.def(Gt("F-scroll-y")),groupItemCount:p.number.def(1),preloadItemCount:p.number.def(1),renderAs:p.string.def("div"),contentAs:p.string.def("div"),scrollOffsetTop:p.number.def(0),scrollPosition:p.string.def("content"),abosuteHeight:p.oneOfType([p.string.def("auto"),p.number]).def("auto"),throttleDelay:p.number.def(60),rowKey:p.string.def(void 0),keepAlive:p.bool.def(!1),...Q7},W7=(e,t)=>{const{renderAs:n,contentAs:i}=e,s=(d,h,m,v,y,C,b)=>{t.emit("content-scroll",[d,{translateY:y,translateX:C,pos:b}])},o=a.resolveDirective("bkVirtualRender"),c={lineHeight:e.lineHeight,handleScrollCallback:s,pagination:{},throttleDelay:e.throttleDelay,onlyScroll:e.scrollEvent},u=a.ref(null),f=({left:d=0,top:h=0})=>{u.value.scrollTo(d,h)};return t.expose({scrollTo:f}),{rendAsTag:()=>{var d,h,m,v,y,C,b,T;return a.h(n,{class:e.className,ref:u},[((h=(d=t.slots).beforeContent)==null?void 0:h.call(d))??"",a.withDirectives(a.h(i,{class:e.contentClassName,style:e.contentStyle},[((v=(m=t.slots).default)==null?void 0:v.call(m,{data:e.list}))??""]),[[o,c]]),((C=(y=t.slots).afterContent)==null?void 0:C.call(y))??"",((T=(b=t.slots).afterSection)==null?void 0:T.call(b))??""])}}};function R3(e,t,n,i){let s=0,o=0,c=0,u=0;for(;s<e;s++){if(u=i(s,[s*n,(s+1)*n,"virtual"]),o+u>t){c=t-o;break}o+=u}return{startIndex:s,height:o,diffHeight:c}}function Dm(e,t,n,i,s){if(!i)return;const o=i.scrollTop,c=i.scrollLeft,{scrollTop:u,count:f,groupItemCount:d,startIndex:h,endIndex:m,scrollLeft:v}=n,{offsetHeight:y}=i;let C=0,b=0,T=0;if(typeof e=="number"&&(C=Math.floor(o/e),b=Math.ceil(y/e)+C,T=o%e),typeof e=="function"){const N=R3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,T=N.diffHeight,b=R3(f,y,d,e).startIndex+C+1}if(o!==u||C!==h||b!==m||v!==c){const N=i.scrollHeight-i.offsetHeight-i.scrollTop;typeof t=="function"&&t(s,C,b,o,T,c,{bottom:N>=0?N:0})}}function H7(e,t,n){const{lineHeight:i=30,handleScrollCallback:s,pagination:o={},onlyScroll:c}=n.value;if(c){const y=t.scrollTop,C=t.scrollLeft,b=t.scrollHeight-t.offsetHeight-t.scrollTop;s(e,null,null,y,y,C,{bottom:b>=0?b:0});return}const{startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollTop:m,scrollLeft:v}=o;Dm(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:v},t,e)}const jm=(e=60)=>st.throttle((t,n,i)=>H7(t,n,i),e),B7=(e,t,n,i=60)=>{Reflect.apply(jm(i),void 0,[e,t,n])},F7={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{B7(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",jm)}}},$7=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:F7},props:_7,emits:["content-scroll"],slots:Object,setup(e,t){const{renderAs:n,contentAs:i}=e,s=D=>typeof D=="string"?[D]:typeof D=="object"&&!Array.isArray(D)?[D]:D;if(!e.enabled){const{rendAsTag:D}=W7(e,t);return D}const o=a.ref(null),c=a.reactive({startIndex:0,endIndex:0,scrollTop:1,scrollLeft:0,translateY:0,translateX:0,count:0,pos:{},groupItemCount:e.groupItemCount}),u=(D,E,P,O,R,J,G)=>{c.startIndex=E,c.endIndex=P,c.scrollTop=O,c.translateY=R,c.translateX=J,c.scrollLeft=J,c.pos=G,t.emit("content-scroll",[D,c])};a.onMounted(()=>{a.nextTick(()=>{m(e.list),v()})}),a.watch(()=>e.list,()=>{let D={left:0,top:0};D={left:c.scrollLeft,top:c.scrollTop},f(),v(),e.keepAlive&&S(D)},{deep:!0}),a.watch(()=>e.lineHeight,()=>{f(),v()});const f=()=>{m(e.list)},d=a.ref(0),h=a.ref(0),m=D=>{if(d.value=Math.ceil((D||[]).length/e.groupItemCount),c.count=d.value,c.startIndex=0,c.endIndex=0,c.translateY=0,c.scrollTop=0,typeof e.abosuteHeight=="string"&&e.abosuteHeight==="auto")if(typeof e.lineHeight=="function"){h.value=0;let P=0;for(let O=0;O<d.value;O++){const R=e.lineHeight.call(this,O,D.slice(O*e.groupItemCount,e.groupItemCount));P+=typeof R=="number"?R:0}h.value=P}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},v=(D={left:0,top:0})=>{var P;const E=(P=o.value)==null?void 0:P.parentNode;Dm(e.lineHeight,u,c,E,null),D&&o.value&&S(D)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,E)=>({...D,$index:E}))),C=a.computed(()=>y.value.slice(c.startIndex*e.groupItemCount,(c.endIndex+e.preloadItemCount)*e.groupItemCount)),b=a.computed(()=>e.scrollPosition==="content"?{top:`${c.scrollTop+e.scrollOffsetTop}px`,transform:`translateY(-${c.translateY}px)`}:{}),T=a.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width,display:"inline-block",...e.scrollPosition==="container"?b.value:{}})),N=a.computed(()=>{const D=typeof e.abosuteHeight=="number"&&e.abosuteHeight===0;return{height:`${h.value<e.minHeight?e.minHeight:h.value}px`,display:D?"none":"block"}}),{resolveClassName:k}=ye(),w=a.computed(()=>[k("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?k("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?k("virtual-content"):"",...s(e.contentClassName)]),x=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},_=()=>{f(),v()},S=(D={left:0,top:0})=>{const{left:E,top:P}=D;o.value.scrollTo(E,P)};return t.expose({reset:_,scrollTo:S}),()=>{var D,E,P,O,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((E=(D=t.slots).beforeContent)==null?void 0:E.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((O=(P=t.slots).default)==null?void 0:O.call(P,{data:C.value}))??""]),[[x,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[k("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}),Gr=Ue($7);var Om=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(Om||{});const G7=a.defineComponent({name:"Tag",props:{theme:Ul(),closable:p.bool.def(!1),type:ze("tagStorkeType",{}).def(Om.UNKNOWN),checkable:p.bool.def(!1),checked:p.bool.def(!1),radius:p.string.def("2px"),extCls:p.string.def("")},emits:["change","close"],slots:Object,setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=a.computed(()=>Ee({[`${n("tag-closable")}`]:e.closable,[`${n("tag-checkable")}`]:e.checkable,[`${n("tag-check")}`]:e.checked,[`${n(`tag-${e.type}`)}`]:e.type,[`${n(`tag-${e.theme}`)}`]:e.theme,[e.extCls]:!!e.extCls},n("tag"))),s=a.computed(()=>({borderRadius:e.radius}));return{wrapperCls:i,wrapperStyle:s,handleClose:u=>{u.preventDefault(),u.stopPropagation(),t("close",u)},handleClick:u=>{u.preventDefault(),u.stopPropagation(),e.checkable&&t("change",!e.checked)},resolveClassName:n}},render(){var e,t;return a.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?a.createVNode("span",{class:`${this.resolveClassName("tag-icon")}`},[this.$slots.icon()]):"",a.createVNode("span",{class:`${this.resolveClassName("tag-text")}`},[(t=(e=this.$slots).default)==null?void 0:t.call(e)]),this.closable?a.createVNode(mn,{class:`${this.resolveClassName("tag-close")}`,onClick:this.handleClose},null):""])}}),Qr=Ue(G7),Z7=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:Ul(),placeholder:p.string.def(""),filterable:p.bool.def(!1),allowCreate:p.bool.def(!1),disabled:p.bool.def(!1),modelValue:p.any,collapseTags:p.bool.def(!1)},emits:["update:modelValue","remove","enter","keydown"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),{proxy:i}=a.getCurrentInstance(),s=a.inject(Sc,null),{modelValue:o,collapseTags:c,selected:u}=a.toRefs(e),f=a.ref(o.value),d=a.ref(),h=a.ref(null);a.watch(o,()=>{f.value=o.value}),a.watch([u,c],()=>{T()},{flush:"post"});const m=N=>{t("remove",N)},v=()=>{var N;(N=d.value)==null||N.focus()},y=N=>{t("update:modelValue",N.target.value)},C=N=>{switch(N.code){case"Enter":{t("enter",N.target.value,N);break}}t("keydown",N.target.value,N)},b=N=>{const k=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?k[N]:k},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=b(),k=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=k>0?k:null}))};return{select:s,overflowTagIndex:h,value:f,inputRef:d,handleRemoveTag:m,focus:v,handleInput:y,handleKeydown:C,resolveClassName:n}},render(){var s,o,c,u,f,d,h,m;const e=(o=(s=this.$slots)==null?void 0:s.prefix)==null?void 0:o.call(s),t=Ee({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=Ee({[this.resolveClassName("select-tag-wrapper")]:!0}),i={display:this.selected.length&&!this.filterable?"none":""};return a.createVNode("div",{class:t},[(u=(c=this.$slots)==null?void 0:c.prefix)==null?void 0:u.call(c),a.createVNode("span",{class:n},[((d=(f=this.$slots).default)==null?void 0:d.call(f))??this.selected.map((v,y)=>a.createVNode(Qr,{closable:!0,theme:this.tagTheme,style:{display:this.collapseTags&&this.overflowTagIndex&&y>=this.overflowTagIndex?"none":""},onClose:()=>this.handleRemoveTag(v.value)},{default:()=>{var C;return[(C=this.select)==null?void 0:C.handleGetLabelByValue(v.value)]}})),!!this.overflowTagIndex&&this.collapseTags&&a.createVNode(Qr,{class:this.resolveClassName("select-overflow-tag")},{default:()=>[a.createTextVNode("+"),this.selected.length-this.overflowTagIndex]}),a.createVNode("input",{class:this.resolveClassName("select-tag-input"),ref:"inputRef",type:"text",style:i,placeholder:this.selected.length?"":this.placeholder,readonly:!this.filterable,disabled:this.disabled,value:this.filterable?this.value:"",onInput:this.handleInput,onKeydown:this.handleKeydown},null)]),(m=(h=this.$slots)==null?void 0:h.suffix)==null?void 0:m.call(h)])}}),Y7=a.defineComponent({name:"Select",directives:{clickoutside:bi},props:{modelValue:p.any,multiple:p.bool.def(!1),disabled:p.bool.def(!1),size:p.size().def(Nf.DEFAULT),clearable:p.bool.def(!0),loading:p.bool.def(!1),filterable:p.bool.def(!1),remoteMethod:p.func,scrollHeight:p.number.def(200),showSelectAll:p.bool.def(!1),popoverMinWidth:p.number.def(0),showOnInit:p.bool.def(!1),multipleMode:p.oneOf(["default","tag"]).def("default"),tagTheme:Ul(),behavior:xg(),collapseTags:p.bool.def(!1),autoHeight:p.bool.def(!0),noDataText:p.string,noMatchText:p.string,loadingText:p.string,placeholder:p.string,searchPlaceholder:p.string,selectAllText:p.string,scrollLoading:p.bool.def(!1),allowCreate:p.bool.def(!1),popoverOptions:Object,customContent:p.bool.def(!1),list:p.array.def([]),idKey:p.string.def("value"),displayKey:p.string.def("label"),withValidate:p.bool.def(!0),showSelectedIcon:p.bool.def(!0),inputSearch:p.bool.def(!0),enableVirtualRender:p.bool.def(!1),allowEmptyValues:p.array.def([]),autoFocus:p.bool.def(!1),keepSearchValue:p.bool.def(!1),prefix:p.string,selectedStyle:zw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ht("select"),{resolveClassName:i}=ye(),{modelValue:s,disabled:o,filterable:c,multiple:u,remoteMethod:f,loading:d,popoverMinWidth:h,showOnInit:m,multipleMode:v,allowCreate:y,customContent:C,showSelectedIcon:b,inputSearch:T,enableVirtualRender:N,showSelectAll:k,scrollHeight:w,list:I,displayKey:x,idKey:L,collapseTags:_,autoHeight:S,popoverOptions:D,allowEmptyValues:E,autoFocus:P,keepSearchValue:O,selectedStyle:R}=a.toRefs(e),J=a.computed(()=>e.noDataText===void 0?n.value.noData:e.noDataText),G=a.computed(()=>e.noMatchText===void 0?n.value.noMatchedData:e.noMatchText),ie=a.computed(()=>e.loadingText===void 0?n.value.loading:e.loadingText),ge=a.computed(()=>e.placeholder===void 0?n.value.pleaseSelect:e.placeholder),ue=a.computed(()=>e.searchPlaceholder===void 0?n.value.enterKeywords:e.searchPlaceholder),ae=a.computed(()=>e.selectAllText===void 0?n.value.all:e.selectAllText),me=ei(),B=a.ref(),Z=a.ref(),H=a.ref(),V=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),te=a.ref(new Map),oe=a.computed(()=>[...te.value.values()]),W=a.ref(new Map),Q=a.ref([]),$=a.computed(()=>Q.value.reduce((Ne,De)=>(Ne[De.value]=De.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,De)=>(Ne[De[L.value]]=De[x.value],Ne),{}));a.watch(s,()=>{var Ne;co(),e.withValidate&&((Ne=me==null?void 0:me.validate)==null||Ne.call(me,"change"))},{deep:!0}),a.watch(Q,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ct.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var De;return(De=hr(String(Ne[x.value])))==null?void 0:De.includes(hr(ni.value))})),de=a.computed(()=>o.value||d.value),be=a.computed(()=>Q.value.map(Ne=>{var De,We;return((We=(De=te.value)==null?void 0:De.get(Ne.value))==null?void 0:We.optionName)||fe.value[Ne.value]||Ne.label})),Ie=a.computed(()=>{const Ne=oe.value.reduce((De,We)=>(We.disabled||De.push(We.optionID),De),[]);return Ne.length<=Q.value.length&&Ne.every(De=>Q.value.some(We=>We.value===De))}),Se=a.computed(()=>!!W.value.size),Ve=a.computed(()=>!oe.value.length),Pe=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),Ce=a.computed(()=>!(Yr.value||Ve.value||Pe.value)||C.value),Le=a.computed(()=>u.value&&k.value&&(!ni.value||!c.value)),Re=a.computed(()=>w.value-12-(Le.value?32:0)),at=a.computed(()=>Yr.value?ie.value:Ve.value?J.value:Pe.value?G.value:""),nt=a.computed(()=>S.value?_.value&&!ti.value:_.value),ct=a.computed(()=>st.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:oo.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:Yl.AUTO},D.value)),{register:He,unregister:Ae}=Pd(te),{register:Be,unregister:ot}=Pd(W),{isHover:qe,setHover:mt,cancelHover:Ze}=ym(),Qt=a.ref(!1),Hi=()=>{Qt.value||(Qt.value=!0,t("focus"))},so=()=>{Qt.value&&(Qt.value=!1,t("blur"))},{popperWidth:oo,isPopoverShow:ti,hidePopover:Bi,showPopover:Zr,togglePopover:Jc}=p7({popoverMinWidth:h.value},Z);a.watch(ti,()=>{t("toggle",ti.value)});const Qc=a.computed(()=>(c.value&&T.value||y.value)&&ti.value);a.watch(ti,Ne=>{Ne?setTimeout(()=>{ya(),lo()},10):O.value||(ni.value="")});const lo=()=>{var We;const Ne=Q.value[0],De=te.value.get(Ne==null?void 0:Ne.value);De&&!De.disabled&&De.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(We=oe.value.find(vn=>!vn.disabled&&vn.visible))==null?void 0:We.optionID},_c=Ne=>{c.value&&oe.value.forEach(De=>{var We;De.visible=(We=hr(String(De.optionName)))==null?void 0:We.includes(hr(Ne))})},{searchKey:ni,searchLoading:Yr}=v7(ce.value?f.value:_c,lo),ii=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},Wc=()=>{de.value||(Hi(),Jc())},Ur=Ne=>{c.value&&(ni.value=Ne)},Hc=(Ne,De)=>{const We=String(Ne);!y.value||!We||c.value&&oe.value.find(en=>hr(String(en.optionName))===hr(We))||te.value.get(We)||(De.stopPropagation(),u.value?(Q.value.push({value:We,label:We}),ii(Q.value.map(en=>en.value))):(Q.value=[{value:We,label:We}],ii(We),Bi()),ni.value="")},va=Ne=>{if(!(de.value||!Ne)){if(u.value){const De=Q.value.findIndex(We=>We.value===Ne.optionID);De>-1?Q.value.splice(De,1):Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),ii(Q.value.map(We=>We.value))}else Q.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],ii(Ne.optionID),Bi();ya()}},ya=()=>{setTimeout(()=>{var Ne,De,We;!T.value&&!y.value?(Ne=V.value)==null||Ne.focus():v.value==="tag"?(De=Y.value)==null||De.focus():(We=B.value)==null||We.focus()},0)},Bc=Ne=>{Ne.stopPropagation(),Q.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Bi()},Fc=()=>{ee.value=""},$c=()=>{Ie.value?Q.value=[]:oe.value.forEach(Ne=>{Ne.disabled||Q.value.find(De=>De.value===Ne.optionID)||Q.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),ii(Q.value.map(Ne=>Ne.value)),ya()},Gc=Ne=>{const{scrollTop:De,clientHeight:We,scrollHeight:vn}=Ne.target;De+We===vn&&t("scroll-end")},Zc=Ne=>{if(de.value)return;const De=Q.value.findIndex(We=>We.value===Ne);De>-1&&(Q.value.splice(De,1),ii(Q.value.map(We=>We.value)))},Kr=Ne=>{var We,vn;let De=Ne;if(typeof De=="object"){for(const en of te.value.keys())if(st.isEqual(en,De)){De=en;break}}return((vn=(We=te.value)==null?void 0:We.get(De))==null?void 0:vn.optionName)||fe.value[De]||$.value[De]||De},co=()=>{Array.isArray(s.value)?Q.value=[...s.value.map(Ne=>({value:Ne,label:Kr(Ne)}))]:s.value!==void 0||E.value.includes(s.value)?Q.value=[{value:s.value,label:Kr(s.value)}]:Q.value=[]},uo=Ne=>{var vn,en;if(!ti.value)return;const De=oe.value.filter(tn=>!tn.disabled&&tn.visible),We=De.findIndex(tn=>tn.optionID===ee.value);if(!(!De.length||We===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const tn=We>=De.length-1?0:We+1;ee.value=(vn=De[tn])==null?void 0:vn.optionID;break}case"ArrowUp":{Ne.preventDefault();const tn=We===0?De.length-1:We-1;ee.value=(en=De[tn])==null?void 0:en.optionID;break}case"Backspace":{if(!u.value||!Q.value.length||ni.value.length||Ne.target===V.value)return;Q.value.pop(),ii(Q.value.map(tn=>tn.value));break}case"Enter":{const tn=te.value.get(ee.value);va(tn);break}}},Yc=({event:Ne})=>{var We;const{target:De}=Ne;(We=Z.value)!=null&&We.contains(De)||Z.value===De||(Bi(),so())},Uc=()=>{setTimeout(()=>{var Ne,De;N.value&&((De=(Ne=X.value)==null?void 0:Ne.reset)==null||De.call(Ne))})};return a.provide(Sc,a.reactive({multiple:u,selected:Q,activeOptionValue:ee,showSelectedIcon:b,selectedStyle:R,register:He,unregister:Ae,registerGroup:Be,unregisterGroup:ot,handleOptionSelected:va,handleGetLabelByValue:Kr})),a.onMounted(()=>{co(),setTimeout(()=>{m.value&&Zr(),P.value&&ya()})}),{selected:Q,isInput:Qc,options:oe,isDisabled:de,selectedLabel:be,isPopoverShow:ti,isHover:qe,popperWidth:oo,inputRef:B,triggerRef:Z,contentRef:H,searchRef:V,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Yr,isOptionsEmpty:Ve,isSearchEmpty:Pe,isFocus:Qt,isShowSelectContent:Ce,curContentText:at,isGroup:Se,searchKey:ni,isShowSelectAll:Le,virtualHeight:Re,virtualList:K,isCollapseTags:nt,popoverConfig:ct,focusInput:ya,setHover:mt,cancelHover:Ze,handleFocus:Hi,handleBlur:so,handleTogglePopover:Wc,handleClear:Bc,hidePopover:Bi,showPopover:Zr,handleToggleAll:$c,handleOptionSelected:va,handleClickOutside:Yc,handleScroll:Gc,handleDeleteTag:Zc,handleInputChange:Ur,handleInputEnter:Hc,handleKeydown:uo,handleSelectedAllOptionMouseEnter:Fc,handlePopoverShow:Uc,localLoadingText:ie,localPlaceholder:ge,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=Ee({[`${this.resolveClassName("select")}`]:!0,"popover-show":this.isPopoverShow,"is-disabled":this.isDisabled,"is-focus":this.isFocus,"is-filterable":this.filterable,[this.size]:!0,[this.behavior]:!0}),t=()=>this.loading?a.createVNode(ca,{loading:!0,theme:"primary",class:"spinner",mode:"spin",size:"mini"},null):this.clearable&&this.isHover&&this.selected.length&&!this.isDisabled?a.createVNode(pn,{class:"clear-icon",onClick:this.handleClear},null):a.createVNode(Ya,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(Z7,{ref:"selectTagInputRef",modelValue:this.searchKey,"onUpdate:modelValue":u=>this.searchKey=u,selected:this.selected,tagTheme:this.tagTheme,placeholder:this.localPlaceholder,filterable:this.isInput,disabled:this.isDisabled,onRemove:this.handleDeleteTag,collapseTags:this.isCollapseTags,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},{prefix:this.prefix?a.createVNode("div",{class:`${this.resolveClassName("select--prefix-area")}`},[a.createVNode("span",null,[this.prefix])]):(c=(o=this.$slots).prefix)==null?void 0:c.call(o),default:this.$slots.tag&&(()=>this.$slots.tag({selected:this.selected})),suffix:()=>t()}):a.createVNode(Ba,a.mergeProps({ref:"inputRef",type:"text",modelValue:this.isInput?this.searchKey:this.selectedLabel.join(","),placeholder:this.isInput?this.selectedLabel.join(",")||this.localPlaceholder:this.localPlaceholder,readonly:!this.isInput,selectReadonly:!0,disabled:this.isDisabled,behavior:this.behavior,size:this.size,withValidate:!1,onInput:this.handleInputChange,onEnter:this.handleInputEnter,onKeydown:(u,f)=>this.handleKeydown(f)},this.prefix?{prefix:this.prefix}:null),{...typeof this.$slots.prefix=="function"?{prefix:()=>{var u,f;return(f=(u=this.$slots).prefix)==null?void 0:f.call(u)}}:null,suffix:()=>t()})},i=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-trigger"),style:{height:this.autoHeight&&this.collapseTags?"32px":""},ref:"triggerRef",onClick:this.handleTogglePopover,onMouseenter:this.setHover,onMouseleave:this.cancelHover},[((c=(o=this.$slots).trigger)==null?void 0:c.call(o,{selected:this.selected}))||n()])},s=()=>{var o,c;return a.createVNode("div",{class:this.resolveClassName("select-content-wrapper"),ref:"contentRef"},[this.filterable&&!this.inputSearch&&a.createVNode("div",{class:this.resolveClassName("select-search-wrapper")},[a.createVNode(Ua,{class:"icon-search",width:16,height:16},null),a.withDirectives(a.createVNode("input",{ref:"searchRef",class:this.resolveClassName("select-search-input"),placeholder:this.localSearchPlaceholder,"onUpdate:modelValue":u=>this.searchKey=u},null),[[a.vModelText,this.searchKey]])]),!this.isShowSelectContent&&a.createVNode("div",{class:this.resolveClassName("select-empty")},[this.searchLoading&&a.createVNode(ca,{class:"mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.curContentText])]),a.createVNode("div",{class:this.resolveClassName("select-content")},[a.createVNode("div",{class:this.resolveClassName("select-dropdown"),style:{maxHeight:`${this.scrollHeight}px`},onScroll:this.handleScroll},[a.withDirectives(a.createVNode("ul",{class:this.resolveClassName("select-options")},[this.isShowSelectAll&&a.createVNode("li",{class:this.resolveClassName("select-option"),onMouseenter:this.handleSelectedAllOptionMouseEnter,onClick:this.handleToggleAll},[this.localSelectAllText]),this.enableVirtualRender?a.createVNode(Gr,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(Dl,{key:f[this.idKey],id:f[this.idKey],name:f[this.displayKey]},{default:(h=(d=this.$slots).virtualScrollRender)==null?void 0:h.call(d,{item:f})})})}):this.list.map(u=>a.createVNode(Dl,{id:u[this.idKey],name:u[this.displayKey]},null)),(c=(o=this.$slots).default)==null?void 0:c.call(o),this.scrollLoading&&a.createVNode("li",{class:this.resolveClassName("select-options-loading")},[a.createVNode(ca,{class:"spinner mr5",theme:"primary",loading:!0,mode:"spin",size:"mini"},null),a.createVNode("span",null,[this.localLoadingText])])]),[[a.vShow,this.isShowSelectContent]])]),this.$slots.extension&&a.createVNode("div",{class:this.resolveClassName("select-extension")},[this.$slots.extension()])])])};return a.createVNode("div",{class:e},[a.createVNode(Kt,a.mergeProps(this.popoverConfig,{onClickoutside:this.handleClickOutside,onAfterShow:this.handlePopoverShow,ref:"popoverRef"}),{default:()=>i(),content:()=>s()})])}}),fh=Xt(Y7,{Option:Dl,Group:y7});function U7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:K7}=Fa,hh=Object.assign({},K7);hh.width.default="400";hh.height.default="100%";const X7=a.defineComponent({name:"Sideslider",components:{BkModal:Fa,BkButton:Pt},props:{...hh,direction:{type:String,default:"right",validator:e=>{const t=["left","right"];return t.indexOf(e)<0?(console.error(`direction property is not valid: '${e}',【${t.join(" | ")}】`),!1):!0}}},emits:["closed","update:isShow","shown","hidden","animation-end"],setup(e,{slots:t,emit:n}){const i=async()=>{let u=!0;typeof e.beforeClose=="function"&&(u=await e.beforeClose()),u&&(n("update:isShow",!1),n("closed"),setTimeout(()=>{n("animation-end")},250))},s=()=>{setTimeout(()=>{n("shown")},200)},o=()=>{setTimeout(()=>{n("hidden")},200)},{resolveClassName:c}=ye();return()=>{const u={header:()=>{var h;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:`${c("sideslider-header")}`},[a.createVNode("div",{class:`${c("sideslider-close")} ${e.direction}`,onClick:()=>{i()}},null),a.createVNode("div",{class:`${c("sideslider-title")} ${e.direction}`},[((h=t.header)==null?void 0:h.call(t))??e.title])])])},default:()=>{var h;return((h=t.default)==null?void 0:h.call(t))??"Content"},footer:()=>t.footer?a.createVNode("div",{class:`${c("sideslider-footer")}`},[t.footer()]):null},f=`${c("sideslider-wrapper")} ${e.scrollable?"scroll-able":""} ${e.extCls}`,d=t.footer?"calc(100vh - 106px)":"calc(100vh - 52px)";return a.createVNode(Fa,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),U7(u)?u:{default:()=>[u]})}}}),Am=Ue(X7);var Em=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Em||{});const J3={theme:p.theme().def(Zl.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:Ig(),status:ze("status",{}).def(Em.UNKNOWN),lineType:Lg(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},q7=a.defineComponent({name:"Steps",props:J3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ht("steps"),i=ht("lang"),s=a.ref([]),o=h=>{const m=[];h.forEach(v=>{typeof v=="string"?m.push(v):m.push({title:v.title,icon:v.icon,description:v.description,status:v.status,border:v.border??!0})}),s.value.splice(0,s.value.length,...m)},c=h=>{J3.curStep=h},u=()=>{var h;s.value.splice(0,s.value.length,{title:n.value.step1,icon:1},{title:n.value.step2,icon:2},{title:n.value.step3,icon:3}),(h=e.steps)!=null&&h.length&&o(e.steps)};a.watch(()=>i.value,()=>{u()});const f=async h=>{try{e.controllable&&h!==e.curStep&&(typeof e.beforeChange=="function"&&await new Promise(async(m,v)=>{const y=await e.beforeChange(h);y?m(y):v(y)}),t("update:curStep",h),t("click",h))}catch(m){console.warn(m)}};a.onMounted(u),a.watch(()=>e.steps,()=>{o(e.steps)},{deep:!0}),a.watch(()=>e.curStep,()=>{c(e.curStep)},{deep:!0});const{resolveClassName:d}=ye();return{defaultSteps:s,jumpTo:f,resolveClassName:d}},render(){const e=this.resolveClassName("steps"),t=this.theme?`${e}-${this.theme}`:"",n=this.size?`${e}-${this.size}`:"",i=Ee({[`${this.extCls}`]:!!this.extCls,[`${this.resolveClassName(`steps-${this.direction}`)}`]:this.direction,[`${this.resolveClassName(`steps-${this.lineType}`)}`]:this.lineType},`${t} ${e} ${n}`),s=m=>this.curStep>m+1||this.defaultSteps[m].status==="done",o=m=>this.curStep===m+1,c=m=>{const{icon:v}=m;return v?Object.prototype.toString.call(v)==="[object Object]":typeof m=="string"},u=(m,v)=>(v.icon||(v.icon=m),!isNaN(v.icon)),f=m=>m.status==="loading",d=m=>m.status==="error",h=(m,v)=>o(m)&&this.status==="loading"||f(v)?a.createVNode(Ks,{class:`${this.resolveClassName("icon")} ${this.resolveClassName("steps-icon")} icon-loading`},null):o(m)&&this.status==="error"||d(v)?a.createVNode(mn,{class:`${this.resolveClassName("steps-icon")}`},null):s(m)?a.createVNode(ga,{class:`${this.resolveClassName("steps-icon")}`},null):a.createVNode("span",null,[u(m,v)?m+1:a.createVNode(v.icon,null,null)]);return a.createVNode("div",{class:i},[this.defaultSteps.map((m,v)=>{var y,C;return a.createVNode("div",{class:[this.resolveClassName("steps"),m.title?"":this.resolveClassName("step-no-content"),s(v)?"done":"",o(v)?"current":"",o(v)&&this.status==="error"?"isError":"",m.status&&o(v)?[`${this.resolveClassName(`step-${m.status}`)}`]:""]},[a.createVNode("span",{class:[`${this.resolveClassName("step-indicator")}`,`${this.resolveClassName(`step-${c(m)?"icon":"number"}`)}`,`${this.resolveClassName(`step-icon${m.status}`)}`],style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(v+1)}},[((C=(y=this.$slots)[v+1])==null?void 0:C.call(y))??h(v,m)]),m.title?a.createVNode("div",{class:`${this.resolveClassName("step-content")}`},[a.createVNode("div",{class:`${this.resolveClassName("step-title")}`,style:{cursor:this.controllable?"pointer":""},onClick:()=>{this.jumpTo(v+1)}},[m.title]),m.description&&a.createVNode("div",{class:`${this.resolveClassName("step-description")}`,title:m.description},[m.description])]):""])})])}}),Pm=Ue(q7),eL=a.defineComponent({name:"Switcher",props:{theme:p.theme(),size:p.size(),disabled:p.bool,showText:p.bool,isOutline:p.bool,onText:p.string.def("ON"),offText:p.string.def("OFF"),isSquare:p.bool,extCls:p.string,beforeChange:p.func.def(void 0),trueValue:p.oneOfType([p.string,p.number,p.bool]).def(!0),falseValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),value:p.oneOfType([p.string,p.number,p.bool]).def(!1),modelValue:p.oneOfType([p.string,p.number,p.bool]).def(!1),withValidate:p.bool.def(!0)},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=ei(),{resolveClassName:i}=ye(),s=a.ref(!1),o=a.computed(()=>e.trueValue===u.value),c=a.ref(e.modelValue!==!1),u=a.computed(()=>c.value?e.modelValue:e.value),f=a.computed(()=>{const m={[e.extCls]:!!e.extCls,[`${i("switcher")}`]:!0,[`${i("switcher-outline")}`]:e.isOutline,[`${i("switcher-square")}`]:e.isSquare,"show-label":e.showText,"is-disabled":e.disabled,"is-checked":o.value,"is-unchecked":!o.value,"is-loading":s.value,[`${i("primary")}`]:e.theme==="primary"};if(e.size&&!e.showText){const v=`${i(`bswitcher-${e.size}`)}`;m[v]=!0}return m});a.watch(()=>e.modelValue,()=>{var m;c.value=!0,e.withValidate&&((m=n==null?void 0:n.validate)==null||m.call(n,"change"))}),a.watch(()=>e.value,()=>{c.value=!1});const d=m=>{if(m.stopPropagation(),m.preventDefault(),e.disabled||s.value)return;const v=o.value?e.falseValue:e.trueValue,y=!o.value,C=()=>{t("update:modelValue",v),t("change",y)};let b=!0;if(typeof e.beforeChange=="function"&&(b=e.beforeChange(v),typeof b.then=="function"))return s.value=!0,b.then(()=>{C()}).finally(()=>{s.value=!1});b&&C()},h=m=>{(m.code==="Enter"||m.key==="Enter"||m.keyCode===13)&&d(m)};return()=>a.createVNode("div",{class:f.value,onClick:d,tabindex:"0",onKeydown:h},[s.value?a.createVNode(yc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),zm=Ue(eL);var jl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(jl||{}),Vm=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(Vm||{});const tL=["auto","highlight"],nL=["none","row","col","outer","horizontal"];var Rn=(e=>(e.ON_SORT_BY_CLICK="onSortByClick",e.ON_FILTER_CLICK="onFilterClick",e.ON_SETTING_CHANGE="onSettingChange",e.ON_ROW_EXPAND_CLICK="onRowExpandClick",e.ON_ROW_CHECK="onRowCheck",e))(Rn||{}),jt=(e=>(e.COLUMN_PICK="columnPick",e.COLUMN_SORT="columnSort",e.COLUMN_FILTER="columnFilter",e.COLUMN_FILTER_SAVE="colFilterSave",e.ROW_CLICK="rowClick",e.ROW_DBL_CLICK="rowDblclick",e.ROW_EXPAND_CLICK="rowExpand",e.ROW_MOUSE_ENTER="rowMouseEnter",e.ROW_MOUSE_LEAVE="rowMouseLeave",e.PAGE_LIMIT_CHANGE="pageLimitChange",e.PAGE_VALUE_CHANGE="pageValueChange",e.SETTING_CHANGE="settingChange",e.SCROLL_BOTTOM="scrollBottom",e.ROW_SELECT="select",e.ROW_SELECT_ALL="selectAll",e.ROW_SELECT_CHANGE="selectionChange",e.CELL_CLICK="cellClick",e.CELL_DBL_CLICK="cellDblclick",e.NATIVE_CLICK="click",e.NATIVE_DBL_CLICK="dblclick",e))(jt||{});const At=(...e)=>!0,iL={columnPick:At,columnFilter:At,columnSort:At,colFilterSave:At,rowClick:At,rowDblclick:At,rowExpand:At,select:At,selectAll:At,selectionChange:At,pageLimitChange:At,pageValueChange:At,settingChange:At,scrollBottom:At,cellClick:At,cellDblclick:At,rowMouseEnter:At,rowMouseLeave:At},$e={ROW_INDEX:"__$table_row_index",ROW_UID:"__$uuid",ROW_EXPAND:"__row_expand",ROW_SELECTION:"__row_selection",ROW_SELECTION_ALL:"__row_selection_all",ROW_SELECTION_INDETERMINATE:"__row_selection_indeterminate",ROW_SOURCE_DATA:"__row_source_data",ROW_SKIP_CFG:"__row_skip_config"},Kn={COL_UID:"__col_$uuid",COL_SOURCE_DATA:"__col_source_data",SORT_TYPE:"__sort_type"},_r=6,Pa=42,vl={large:78,medium:60,small:42},aL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:vl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:vl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:vl.large}],Rm="InitColumns",Jm="BKTableCahce",rL="Bk_COlumn_Update_Define";var Et=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Et||{});const sL=["asc","desc","null","custom"],Cr=80;var Qm=(e=>(e.CURRENT="current",e.ALL="all",e))(Qm||{});const gh=ze("showOverflowTooltipMode",{default:"auto"}),oL=ze("columnType",{default:"none"}),Fd=ze("columnType",{default:""}),lL=ze("full",{default:"full"});var _m=(e=>(e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e))(_m||{});const Wm=ze("columnSize",{default:"small"}),cL=fn(),Q3=ze("sortScope",{}).def("current");var Hm=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(Hm||{});const Bm={label:p.oneOfType([p.func.def(()=>""),p.string.def("")]),field:p.oneOfType([p.func.def(()=>""),p.string.def("")]),render:p.oneOfType([p.func.def(()=>""),p.string.def("")]),width:p.oneOfType([p.number.def(void 0),p.string.def("auto")]),minWidth:p.oneOfType([p.number.def(void 0),p.string.def("auto")]).def(30),columnKey:p.string.def(""),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.oneOfType([p.string,p.func]),disabled:p.oneOfType([p.bool,p.func]),watchCellResize:p.bool.def(!0),mode:gh})]).def(void 0),type:oL,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,cL]).def(!1),sort:p.oneOfType([p.shape({sortFn:p.func.def(void 0),sortScope:Q3,value:p.string.def(Et.NULL)}),p.bool,p.string]).def(!1),filter:p.oneOfType([p.shape({list:p.arrayOf(p.any).def([]),filterFn:p.func.def(void 0),match:lL,checked:p.arrayOf(p.any).def([]),filterScope:Q3,btnSave:p.oneOfType([p.bool,p.string]).def("确定"),btnReset:p.oneOfType([p.bool,p.string]).def("重置")}),p.bool,p.string]).def(!1),colspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),rowspan:p.oneOfType([p.func.def(()=>1),p.number.def(1)]),align:Fd,className:p.oneOfType([p.string,p.func])},uL={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(p.shape(Bm).loose).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ze("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),minHeight:p.oneOfType([p.number,p.string]).def(Pa*2),maxHeight:p.oneOfType([p.number,p.string]).def("auto"),rowHeight:p.oneOfType([p.number,p.func]).def(Pa),headHeight:p.number.def(Pa),showHead:p.bool.def(!0),thead:p.shape({height:p.number.def(Pa),isShow:p.bool.def(!0),cellFn:p.func.def(void 0)}),stripe:p.bool.def(!1),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ze("boderType",{})),p.string]).def([jl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(60),remotePagination:p.bool.def(!1),emptyText:p.string,settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:Wm,sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),rowClass:p.oneOfType([p.string,p.object,p.func]).def({}),rowStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellStyle:p.oneOfType([p.string,p.object,p.func]).def({}),cellClass:p.oneOfType([p.string,p.object,p.func]).def({}),scrollLoading:p.oneOfType([p.object,p.bool]).def(void 0),reserveExpand:p.bool.def(!1),selectionKey:p.string.def(""),isSelectedFn:p.func.def(void 0),rowKey:p.oneOfType([p.string,p.func]).def($e.ROW_INDEX),showOverflowTooltip:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:gh})]).def(!1),asyncData:p.bool.def(!1),rowHover:p.oneOf(tL).def(Vm.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ze("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:Fd,headerAlign:Fd,prependStyle:p.style().def({})},dL=a.defineComponent({name:"TableColumn",props:{...Bm,prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},setup(e){const t=a.inject(Rm,(s,o=!1)=>{},!1),n=a.inject(Jm,{queueStack:(s,o)=>o==null?void 0:o()}),i=a.reactive({...e,field:e.prop||e.field});return{initColumns:t,bkTableCache:n,column:i}},unmounted(){this.updateColumnDefine(!0)},mounted(){this.updateColumnDefine()},methods:{updateColumnDefine(e=!1){if(this.$props.index!==void 0&&typeof this.$props.index=="number"){this.updateColumnDefineByIndex(e);return}this.updateColumnDefineByParent()},updateColumnDefineByParent(){const e=()=>{const n=this._.parent.vnode.children.default()||[],i=[],s=o=>{Array.isArray(o)&&o.forEach(c=>{var f,d,h;if(Array.isArray(c)){s(c);return}let u=!0;if(((f=c.type)==null?void 0:f.name)==="TableColumn"){u=Object.hasOwnProperty.call(c.props||{},"key");const m={...c.props,field:c.props.prop||c.props.field,render:(d=c.children)==null?void 0:d.default};i.push(a.unref(m))}(h=c.children)!=null&&h.length&&u&&s(c.children)})};s(n),this.initColumns(i)};typeof this.bkTableCache.queueStack=="function"&&this.bkTableCache.queueStack(rL,e)},updateColumnDefineByIndex(e=!1){const t={...this.$props,field:this.$props.prop||this.$props.field,render:this.$slots.default};this.initColumns(a.unref(t),e)}},render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{}})])}});class fL{constructor(){ke(this,"storage");this.storage={}}queueStack(t,n=()=>{}){this.storage[t]&&clearTimeout(this.storage[t]),this.storage[t]=setTimeout(()=>n())}clearQueueStack(t){this.storage[t]&&clearTimeout(this.storage[t])}}const _3=(e,t)=>{if(e){if(typeof e=="object"){let n=Object.prototype.hasOwnProperty.call(e,"current")?e.current:e.value;return/\d+/.test(n)||(n=1),{...t,...e,current:n}}return t}return{}},hL=(e,t)=>{const n=a.ref(0),i=a.ref(0);let s=a.reactive({count:0,limit:10,current:1,align:"right",layout:["total","limit","list"]});s=_3(e.pagination,s);const o=a.ref(null),c=()=>{if(!e.pagination||e.remotePagination){n.value=0,i.value=t.length;return}n.value=(s.current-1)*s.limit,i.value=s.current*s.limit},u=a.reactive([]),f=(y,C,b)=>{typeof C=="function"&&y.sort((T,N)=>C(T,N,b[Kn.SORT_TYPE]))},d=(y,C)=>{if(typeof C=="function"){const b=y.filter((T,N)=>C(T,N,t));y.length=0,y.push(...b)}},h=(y,C,b)=>{const T=t.slice(),{sortScope:N}=(b==null?void 0:b.sort)??{};N===Qm.ALL&&f(T,C,b),u.length=0,u.push(...T.slice(n.value,i.value)),d(u,y),f(u,C,b)},m=(y,C,b)=>{s=_3(e.pagination,s),v(),c(),h(y,C,b)},v=()=>{e.pagination&&(o.value=e.remotePagination?s:{...s,count:t.length})};return{pageData:u,localPagination:o,resolvePageData:h,watchEffectFn:m}},gL=(e,t)=>{const n=a.toRef(e,"scrollLoading"),i=()=>typeof n.value=="boolean"?{loading:!!n.value,inline:!0,title:"",size:Qa.Normal,mode:nh.Default,indicator:null}:n.value,s=a.computed(()=>n.value!==null&&(typeof n.value=="boolean"&&n.value||typeof n.value=="object"));return{renderScrollLoading:()=>{var c,u;if(s.value){const{loading:f,size:d,mode:h,title:m,inline:v,indicator:y}=i();return((u=(c=t.slots).fixedBottom)==null?void 0:u.call(c))??a.createVNode(ca,{loading:f,size:d,mode:h,title:m,inline:v,indicator:y},null)}}}};function mL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const pL=e=>{const{proxy:t}=a.getCurrentInstance(),n=a.ref(t.limit);a.watch(()=>t.limit,c=>{n.value=c}),a.watch(()=>t.limitList,c=>{a.nextTick(()=>{c.includes(n.value)||([n.value]=c)})},{immediate:!0});const i=c=>{n.value=c},{resolveClassName:s}=ye();return{limit:n,render:({isFirst:c,isLast:u})=>{let f;return t.showLimit?a.createVNode("div",a.mergeProps({class:{[s("pagination-limit")]:!0,"is-first":c,"is-last":u}},{disabled:t.disabled}),[a.createVNode("div",null,[e.value.eachPage]),a.createVNode(fh,{class:`${s("pagination-limit-select")}`,clearable:!1,size:"small",withValidate:!1,modelValue:n.value,onChange:i,disabled:t.disabled},mL(f=t.limitList.map((d,h)=>a.createVNode(Dl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},ka=5,vL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(1),n=a.computed(()=>t.value===1),i=a.computed(()=>t.value===e.totalPageNum),s=a.ref(!1),o=a.ref(!1),c=a.computed(()=>{s.value=!1,o.value=!1;const C=[];if(e.totalPageNum<=ka+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(ka/2);e.totalPageNum>ka&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const T=Math.min(e.totalPageNum-ka,Math.max(2,t.value-b));for(let N=T;N<T+ka;N++)C.push(N);return C});a.watch(()=>e.modelValue,C=>{a.nextTick(()=>{C>=1&&C<=e.totalPageNum?t.value=C:C<1?t.value=1:t.value=e.totalPageNum})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,C=>{t.value>C&&(t.value=C)})});const u=()=>{n.value||(t.value=t.value-1)},f=()=>{i.value||(t.value=t.value+1)},d=C=>{C!==t.value&&(t.value=C)},h=()=>{t.value=Math.max(1,t.value-ka)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+ka)},{resolveClassName:v}=ye();return{current:t,render:({isFirst:C,isLast:b})=>a.createVNode("div",{class:{[`${v("pagination-list")}`]:!0,"is-first":C,"is-last":b}},[a.createVNode("div",{class:{[`${v("pagination-list-pre")}`]:!0,"is-disabled":n.value},onClick:u},[e.prevText||a.createVNode(Ci,null,null)]),a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===1},key:"1",onClick:()=>d(1)},[a.createTextVNode("1")]),s.value&&a.createVNode("div",{key:"pre-batch",class:`${v("pagination-list-pre-batch")}`,onClick:h},[a.createVNode(Rs,null,null)]),c.value.map(T=>a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===T},key:T,onClick:()=>d(T)},[T])),o.value&&a.createVNode("div",{key:"next-batch",class:`${v("pagination-list-next-batch")}`,onClick:m},[a.createVNode(Rs,null,null)]),e.totalPageNum>1&&a.createVNode("div",{class:{[`${v("pagination-list-item")}`]:!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:()=>d(e.totalPageNum)},[e.totalPageNum]),a.createVNode("div",{class:{[`${v("pagination-list-pre")}`]:!0,"is-disabled":i.value},onClick:f},[e.nextText||a.createVNode(Wn,null,null)])])}},yL=()=>{const{proxy:e}=a.getCurrentInstance(),t=a.ref(null),n=a.ref(!1),i=a.ref(1),s=a.computed(()=>i.value===1),o=a.computed(()=>i.value===e.totalPageNum);let c=0;const u=a.computed(()=>{const N=[];for(let k=1;k<=e.totalPageNum;k++)N.push(k);return N});a.watch(()=>e.modelValue,N=>{a.nextTick(()=>{N>=1&&N<=e.totalPageNum?i.value=N:N<1?i.value=1:i.value=e.totalPageNum,c=i.value})},{immediate:!0}),a.nextTick(()=>{a.watch(()=>e.totalPageNum,N=>{i.value>N&&(i.value=N)})});const f=()=>{s.value||(i.value=i.value-1)},d=()=>{o.value||(i.value=i.value+1)},h=()=>{n.value=!0},m=()=>{n.value=!1,t.value.textContent=`${c}`,c!==i.value&&(i.value=c)},v=N=>{const k=N.target,w=Number(k.textContent);!w||w<1||w>e.totalPageNum||w===i.value||(c=w)},y=N=>{["Enter","NumpadEnter"].includes(N.code)&&(N.preventDefault(),m())},C=N=>{c=N,m()},{resolveClassName:b}=ye();return{current:i,render:()=>a.createVNode("div",{class:`${b("pagination-small-list")}`},[a.createVNode("div",{class:{[`${b("pagination-btn-pre")}`]:!0,"is-disabled":s.value},onClick:f},[a.createVNode(Ci,null,null)]),a.createVNode(Kt,{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:()=>a.createVNode("div",{class:{[`${b("pagination-picker")}`]:!0,"is-focused":n.value}},[a.createVNode("span",{ref:t,class:`${b("pagination-editor")}`,contenteditable:!0,spellcheck:"false",onFocus:h,onBlur:m,onInput:v,onKeydown:y},[i.value]),a.createVNode("span",null,[a.createTextVNode("/")]),a.createVNode("span",{class:`${b("pagination-small-list-total")}`},[e.totalPageNum])]),content:()=>a.createVNode("div",{class:`${b("pagination-picker-list")}`},[u.value.map(N=>a.createVNode("div",{class:{item:!0,"is-actived":N===i.value},key:N,onClick:()=>C(N)},[N]))])}),a.createVNode("div",{class:{[`${b("pagination-btn-next")}`]:!0,"is-disabled":o.value},onClick:d},[a.createVNode(Wn,null,null)])])}},CL=e=>({isFirst:t,isLast:n})=>{const{props:i}=a.getCurrentInstance();if(!i.showTotalCount)return null;const{resolveClassName:s}=ye();return a.createVNode("div",a.mergeProps({class:{[`${s("pagination-total")}`]:!0,"is-first":t,"is-last":n}},{disabled:i.disabled}),[e.value.total,a.createVNode("div",{class:`${s("pagination-total-num")}`},[i.count]),e.value.strip])},bL={modelValue:p.number.def(1),count:p.number.def(0).isRequired,limit:p.number.def(10),limitList:p.arrayOf(Number).def([10,20,50,100]),showLimit:p.bool.def(!0),type:p.oneOf(["default","compact"]).def("default"),location:p.oneOf(["left","right"]).def("right"),align:p.oneOf(["left","center","right"]).def("left"),size:p.size(),small:p.bool.def(!1),showTotalCount:p.bool.def(!0),prevText:p.string,nextText:p.string,disabled:p.bool.def(!1),beforeChange:p.func,layout:p.custom(e=>{const t={total:!0,list:!0,limit:!0};return e.some(n=>t[n])},"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},wL=a.defineComponent({name:"Pagination",props:bL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ht("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=CL(n),{current:u,render:f}=vL(),{current:d,render:h}=yL(),{limit:m,render:v}=pL(n);a.watch([s,m,o],([C,b])=>{const T=Math.ceil(C/b);i.value=T<1?1:T},{immediate:!0}),a.watch(u,C=>{t.emit("update:modelValue",C),t.emit("change",C)}),a.watch(d,C=>{e.small&&(t.emit("update:modelValue",C),t.emit("change",C))}),a.watch(m,C=>{t.emit("limitChange",C)});const{resolveClassName:y}=ye();return{totalPageNum:i,renderTotal:c,renderList:f,renderLimit:v,renderSmallList:h,resolveClassName:y}},render(){const e=Ee({[`${this.resolveClassName("pagination")}`]:!0,[`${this.resolveClassName(`pagination--${this.size}`)}`]:!0,[`is-align-${this.align}`]:!0}),t={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return a.createVNode("div",{class:e},[this.layout.map((n,i)=>t[n]({isFirst:i===0,isLast:i===this.layout.length-1}))])}}),mh=Ue(wL);var Fm=function(){if(typeof Map<"u")return Map;function e(t,n){var i=-1;return t.some(function(s,o){return s[0]===n?(i=o,!0):!1}),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var i=e(this.__entries__,n),s=this.__entries__[i];return s&&s[1]},t.prototype.set=function(n,i){var s=e(this.__entries__,n);~s?this.__entries__[s][1]=i:this.__entries__.push([n,i])},t.prototype.delete=function(n){var i=this.__entries__,s=e(i,n);~s&&i.splice(s,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,i){i===void 0&&(i=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(i,c[1],c[0])}},t}()}(),$d=typeof window<"u"&&typeof document<"u"&&window.document===document,Ol=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),NL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ol):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ML=2;function IL(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){NL(o)}function u(){var f=Date.now();if(n){if(f-s<ML)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var LL=20,TL=["top","right","bottom","left","width","height","size","weight"],xL=typeof MutationObserver<"u",kL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=IL(this.refresh.bind(this),LL)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,i=n.indexOf(t);~i&&n.splice(i,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!$d||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xL?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!$d||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,i=n===void 0?"":n,s=TL.some(function(o){return!!~i.indexOf(o)});s&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),$m=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var s=i[n];Object.defineProperty(e,s,{value:t[s],enumerable:!1,writable:!1,configurable:!0})}return e},Wr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ol},Gm=Dc(0,0,0,0);function Al(e){return parseFloat(e)||0}function W3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(i,s){var o=e["border-"+s+"-width"];return i+Al(o)},0)}function SL(e){for(var t=["top","right","bottom","left"],n={},i=0,s=t;i<s.length;i++){var o=s[i],c=e["padding-"+o];n[o]=Al(c)}return n}function DL(e){var t=e.getBBox();return Dc(0,0,t.width,t.height)}function jL(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Gm;var i=Wr(e).getComputedStyle(e),s=SL(i),o=s.left+s.right,c=s.top+s.bottom,u=Al(i.width),f=Al(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=W3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=W3(i,"top","bottom")+c)),!AL(e)){var d=Math.round(u+o)-t,h=Math.round(f+c)-n;Math.abs(d)!==1&&(u-=d),Math.abs(h)!==1&&(f-=h)}return Dc(s.left,s.top,u,f)}var OL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Wr(e).SVGGraphicsElement}:function(e){return e instanceof Wr(e).SVGElement&&typeof e.getBBox=="function"}}();function AL(e){return e===Wr(e).document.documentElement}function EL(e){return $d?OL(e)?DL(e):jL(e):Gm}function PL(e){var t=e.x,n=e.y,i=e.width,s=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return $m(c,{x:t,y:n,width:i,height:s,top:n,right:t+i,bottom:s+n,left:t}),c}function Dc(e,t,n,i){return{x:e,y:t,width:n,height:i}}var zL=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dc(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=EL(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),VL=function(){function e(t,n){var i=PL(n);$m(this,{target:t,contentRect:i})}return e}(),RL=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new Fm,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=i}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Wr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new zL(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Wr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(i){return new VL(i.target,i.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Zm=typeof WeakMap<"u"?new WeakMap:new Fm,Ym=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=kL.getInstance(),i=new RL(t,n,this);Zm.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Ym.prototype[e]=function(){var t;return(t=Zm.get(this))[e].apply(t,arguments)}});var JL=function(){return typeof Ol.ResizeObserver<"u"?Ol.ResizeObserver:Ym}();const Rt=(e,t,n)=>{if(typeof t=="string")return Object.prototype.hasOwnProperty.call(e,t)?typeof e[t]=="function"?e[t].call(globalThis,...n):e[t]:void 0;if(Array.isArray(t))return t.map(i=>Rt(e,i,n)).filter(i=>i!==void 0).at(0)},hd=e=>/^\d+$/.test(`${e}`)?[parseInt(`${e}`,10)]:[],QL=e=>Um(e,"auto"),Um=(e,t="100%",n=null)=>{let i="";return/^auto|null|undefined$/ig.test(`${e}`)?i=t:i=/^\d+\.?\d+$/.test(`${e}`)?`${e}px`:e,n&&(i=`calc(${i} - ${n})`),i},_L=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>nL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},Ds=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],gd=(e,t,n=Cr,i=0)=>{const{width:s}=e.getBoundingClientRect()||{},o=s-i;let c=o;const u=[],f=(h,m)=>{const{minWidth:v=void 0}=h;if(v===void 0)return m<Cr?Cr:m;let y=m;return/^\d+\.?\d*$/.test(`${v}`)&&(y=Number(v)),/^\d+\.?\d*%$/.test(`${v}`)&&(y=Number(v)*o/100),/^\d+\.?\d*px$/i.test(`${v}`)&&(y=Number(`${v}`.replace(/px/i,""))),y},d=(h,m,v=!0)=>{const y=f(h,m),C=m<y?y:m;Object.assign(h,{calcWidth:C}),v&&(c=c-C,c<0&&(c=0))};if(t.forEach((h,m)=>{if(!h.isHidden){const y=String(Ds(h,["resizeWidth","width"]));let C=!0;if(/^\d+\.?\d*(px)?$/.test(y)){const b=Number(y.replace("px",""));d(h,b),C=!1}if(/^\d+\.?\d*%$/.test(y)){let b=n;if(c>0){const T=Number(y.replace("%",""));b=c*T/100}d(h,b),C=!1}C&&u.push(m)}}),u.length>0){let h=n;c>0?u.forEach((m,v)=>{h=c/(u.length-v),d(t[m],h,!1);const{calcWidth:y}=t[m];c=c-y}):u.forEach(m=>{const v=f(t[m],Cr);Object.assign(t[m],{calcWidth:v})})}},Km=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?st.debounce(o,n):st.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new JL(()=>{u()});return i&&typeof t=="function"&&t(),{start:()=>{f.observe(e)},disconnect:()=>{f.unobserve(e),f.disconnect()}}},Gd=e=>{const{showHead:t,headHeight:n,thead:i={}}=e;return Object.assign({},{isShow:t,height:n},{...i})},El=(e,t,n)=>n.type==="index"?e[$e.ROW_INDEX]+1:st.get(e,t),Ns=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?Ns(Reflect.apply(e,globalThis,t),t):[],Xm=(e,t,n)=>{const i=qm(e,t,n);return i!==null?i:Vi.v4()},qm=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===$e.ROW_INDEX?`__ROW_INDEX_${n}`:st.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,WL=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},e1=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),H3=(e,t,n,i,s)=>typeof e[s]=="function"?Reflect.apply(e[s],globalThis,[{column:e,colIndex:t,row:n,rowIndex:i}]):typeof e[s]=="number"?e[s]:1,t1=(e,t,n,i)=>{const s=H3(e,t,n,i,"colspan"),o=H3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},n1=(e,t)=>{var c,u;const n=e.field,i=f=>El(f,n,e),s=(f,d)=>{const h=i(f)||"",m=i(d)||"";return typeof h=="number"&&typeof m=="number"?h-m:String.prototype.localeCompare.call(h,m)},o=typeof((c=e.sort)==null?void 0:c.sortFn)=="function"?(u=e.sort)==null?void 0:u.sortFn:s;return t===Et.NULL?()=>!0:(f,d)=>o(f,d)*(t===Et.DESC?-1:1)},i1=e=>{const t={[Et.NULL]:0,[Et.ASC]:1,[Et.DESC]:2};return e===void 0?Et.NULL:Object.keys(t)[(t[e]+1)%3]},a1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Et.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},yl=(e,{row:t,index:n,isCheckAll:i})=>typeof e.isRowSelectEnable=="boolean"?e.isRowSelectEnable!==!1:typeof e.isRowSelectEnable=="function"?e.isRowSelectEnable({row:t,index:n,isCheckAll:i}):!0,HL=(e,t,n)=>{if(e[$e.ROW_UID]!==void 0)return e[$e.ROW_UID];const i=Xm(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},js=e=>a.unref(e[$e.ROW_SOURCE_DATA]||e),r1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),B3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:p.oneOfType([p.bool,p.shape({content:p.string.def(""),disabled:p.bool.def(!1),watchCellResize:p.bool.def(!0),mode:gh})]).def(void 0),title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ze("ResizerWay",{default:Hm.DEBOUNCE})},setup(e,{slots:t}){const n=a.ref(),i=a.ref(!1),s=a.computed(()=>({textAlign:e.column.textAlign})),o=()=>/boolean|object/.test(typeof e.column.showOverflowTooltip)&&e.column.showOverflowTooltip!==null?e.column:{showOverflowTooltip:e.parentSetting},{showOverflowTooltip:c=!1}=o();let u=null;const f=()=>{let h=!0,{resizerWay:m}=e,v=n.value.innerText,y="auto",C=!0;return typeof c=="boolean"&&(h=!c),typeof c=="object"&&(h=c.disabled,m=c.resizerWay||"debounce",v=c.content||n.value.innerText,typeof c.content=="function"&&(v=c.content(e.column,e.row)),C=c.watchCellResize,y=c.mode||"auto"),typeof h=="function"&&(h=Reflect.apply(h,this,[e.column,e.row])),{disabled:h,content:v,mode:y,resizerWay:m,watchCellResize:C}},d=()=>{if(!n.value||!Va(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=Fb(n.value)),h==="static"&&(i.value=!0),i.value){const v=a.ref(f());u===null&&(u=dh(n.value,{disabled:v.value.disabled,content:v.value.content,mode:v.value.mode}))}else u==null||u.destroyInstance(n.value),u=null};return a.onMounted(()=>{const{disabled:h,resizerWay:m,watchCellResize:v}=f();if(!h&&(d(),v!==!1&&e.observerResize)){let y=Km(n.value,()=>{d()},60,!0,m);y.start(),a.onBeforeUnmount(()=>{y.disconnect(),y=null})}}),a.onBeforeUnmount(()=>{u==null||u.destroyInstance(n.value)}),()=>{var h;return a.createVNode("div",{class:["cell",e.column.type],style:s.value,ref:n,title:e.title},[(h=t.default)==null?void 0:h.call(t)])}}}),md=a.defineComponent({name:"TableRow",render(){var e,t;return a.createVNode(a.Fragment,null,[(t=(e=this.$slots).default)==null?void 0:t.call(e)])}});class BL{constructor(t,n){ke(this,"props",null);ke(this,"ctx",null);this.props=t,this.ctx=n}}const FL=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ht("table"),n=a.computed(()=>e.emptyText===void 0?t.value.emptyText:e.emptyText),i=a.computed(()=>e.list.length===0?"empty":"search-empty");return()=>a.createVNode(Tc,{scene:"part",type:i.value,description:n.value},null)}}),$L=a.defineComponent({name:"HeadFilter",props:{column:p.any.def({}),height:p.number.def(Pa)},emits:["change","filterSave"],setup(e,{emit:t}){var P;const{resolveClassName:n}=ye(),i=ht("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((P=o.value)==null?void 0:P.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>Ee({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=Ee({[n("table-head-filter")]:!0}),h=a.ref(null),m=O=>{u.isOpen=O,O&&setTimeout(()=>{h.value.reset()})},v=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:O=[]}=o.value;return O}),C=(O,R="ig")=>new RegExp(`${O}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),b=(O,R)=>{const{match:J}=o.value,G=El(R,Rt(s,"field",[s,R]),s);return J==="full"&&O.includes(G),O.some(ie=>C(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(O,R,J,G)=>o.value.filterFn(O,R,e.column,J,G):(O,R)=>O.length?b(O,R):!0,N=()=>{k(!0),t("filterSave",[...u.checked]),u.isOpen=!1},k=(O=!1)=>{const{disabled:R}=I(x,i.value.confirm);if(R||O){if(o.value==="custom"){t("change",[...u.checked],null),u.isOpen=!1;return}o.value.checked=u.checked,t("change",[...u.checked],T)}},w=()=>{u.checked.length&&(u.checked.length=0,u.isOpen=!1,a.nextTick(()=>t("change",u.checked,T)))},I=(O,R)=>({disabled:O==="disabled"||O===!1,text:typeof O=="string"?O:R}),{btnSave:x,btnReset:L}=o.value,_=()=>{const{disabled:O,text:R}=I(x,i.value.confirm);return O?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},S=()=>{const{disabled:O,text:R}=I(L,i.value.reset);return O?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(O,R)=>{const J=new Set(u.checked);O?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),k()},E=O=>O.data.length?O.data.map(R=>a.createVNode("div",{class:"list-item"},[a.createVNode(Xn,{label:R.value,key:R.$index,immediateEmitChange:!1,checked:u.checked.includes(R.value),modelValue:u.checked.includes(R.value),onChange:J=>D(J,R)},{default:()=>[`${R.text}`]})])):a.createVNode("div",{class:"list-item is-empty"},[i.value.emptyText]);return()=>a.createVNode(Kt,a.mergeProps({trigger:"click",isShow:u.isOpen,placement:"bottom-start",renderType:Yl.SHOWN,arrow:!1,offset:0},{theme:v},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(gc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Lc,{class:"content-list"},{default:()=>[a.createVNode(Gr,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:E})]}),a.createVNode("div",{class:"content-footer"},[_(),a.createVNode("span",{class:"btn-filter-split"},null),S()])])})}}),GL=a.defineComponent({name:"HeadSort",props:{column:p.any.def({}),defaultSort:p.oneOf(sL).def(Et.NULL),active:p.bool},emits:["change"],setup(e,{emit:t}){var c,u;const{resolveClassName:n}=ye(),i=((u=(c=e.column)==null?void 0:c.sort)==null?void 0:u.value)||e.defaultSort||Et.NULL,s=a.ref(i);a.watch(()=>[e.defaultSort],([f])=>{s.value=f});const o=(f,d)=>{f.stopImmediatePropagation(),f.stopPropagation(),f.preventDefault();let h=d;d===Et.NULL&&(h=i1(d)),s.value===d&&(h=Et.NULL);const m=n1(e.column,h),v=a1(e.column.sort);if((v==null?void 0:v.value)==="custom"){t("change",(v==null?void 0:v.sortFn)??m,h);return}t("change",m,h)};return()=>a.createVNode("span",{class:n("head-cell-sort"),onClick:f=>o(f,Et.NULL)},[a.createVNode(ec,{class:["sort-action","sort-asc",e.active&&s.value===Et.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Et.ASC)},null),a.createVNode(Us,{class:["sort-action","sort-desc",e.active&&s.value===Et.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Et.DESC)},null)])}});function F3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const ZL=a.defineComponent({name:"Settings",props:{settings:p.oneOfType([p.shape({fields:p.arrayOf(p.shape({label:p.string,field:p.string,disabled:p.bool})),checked:p.arrayOf(p.string),limit:p.number.def(0),size:Wm.def(_m.SMALL),sizeList:p.shape([]),showLineHeight:p.bool.def(!0)}),p.bool]).def(!1),columns:p.array.def([]),rowHeight:p.number.def(Pa)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=ht("table"),s=aL(i),o=(J,G)=>Rt(J,["field","type"],[J,G]),c=a.ref(!1),u=a.ref(!1),f=a.computed(()=>typeof e.settings=="boolean"?{fields:e.columns.map(J=>({...J,field:J.field||J.type})),checked:[],limit:0,size:"small",sizeList:s,showLineHeight:!0}:e.settings),d=a.ref(f.value.size||"small"),h=a.ref(e.rowHeight),m=a.ref(f.value.checked||[]),y=`light ${n("table-settings")}`,C=a.computed(()=>f.value.fields||e.columns||[]),b={checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:f.value.checked||[]},T=()=>{Object.assign(b,{checkAll:c.value,activeSize:d.value,activeHeight:h.value,checkedFields:m.value}),t("change",{checked:m.value,size:d.value,height:h.value,fields:a.unref(C)}),u.value=!1},N=()=>{c.value=b.checkAll,d.value=b.activeSize,h.value=b.activeHeight,m.value=b.checkedFields,u.value=!1},k=()=>{u.value=!0},w=J=>{J.stopImmediatePropagation(),J.stopPropagation(),J.preventDefault(),c.value=!c.value;const G=f.value.fields||e.columns||[],ie=G.filter((ge,ue)=>ge.disabled&&m.value.includes(o(ge,ue))).map((ge,ue)=>o(ge,ue));if(c.value){const ge=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...ge,...ie)}else m.value.splice(0,m.value.length,...ie)},I=a.computed(()=>(f.value.limit??0)>0),x=f.value.sizeList||s,L=a.computed(()=>I.value&&(f.value.limit?f.value.limit:0)<=m.value.length),_=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),S=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),E={marginRight:"12px"},P=()=>x.map(J=>a.createVNode("span",{class:D(J),onClick:()=>S(J)},[J.label])),O=a.computed(()=>m.value.length>0&&!C.value.every((J,G)=>m.value.includes(Rt(J,"field",[J,G])))),R=a.computed(()=>typeof f.value.showLineHeight=="boolean"?f.value.showLineHeight:!0);return a.watch(()=>[m.value],()=>{m.value.length||(c.value=!1),m.value.length&&C.value.every((J,G)=>m.value.includes(o(J,G)))&&(c.value=!0)},{immediate:!0,deep:!0}),a.watch(()=>[e.settings.checked],()=>{m.value.splice(0,m.value.length,...f.value.checked)},{immediate:!0,deep:!0}),()=>e.settings?a.createVNode(Kt,a.mergeProps({trigger:"manual",isShow:u.value,placement:"bottom-end",arrow:!0},{theme:y}),{default:()=>a.createVNode("span",{class:"table-head-settings",onClick:k},[a.createVNode(rc,{style:"color: #c4c6cc;"},null)]),content:()=>{let J;return a.createVNode("div",{class:"setting-content"},[a.createVNode("div",{class:"setting-head"},[a.createVNode("span",{class:"head-title"},[i.value.setting.title]),a.createVNode(Xs,{class:"icon-close-action",onClick:N},null)]),a.createVNode("div",{class:"setting-body"},[a.createVNode("div",{class:"setting-body-title"},[a.createVNode("div",null,[a.createVNode("span",{class:"field-setting-label"},[i.value.setting.fields.title]),I.value?a.createVNode("span",{class:"limit"},[i.value.setting.fields.subtitle(f.value.limit)]):""]),I.value?"":a.createVNode("span",{class:"check-all",onClick:w},[a.createVNode(Xn,{label:i.value.setting.fields.selectAll,indeterminate:!!O.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Lc,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},F3(J=C.value.map((G,ie)=>{let ge;return a.createVNode("div",{class:"field-item"},[a.createVNode(Xn,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:_(G,ie)},F3(ge=Rt(G,"label",[G,ie]))?ge:{default:()=>[ge]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),P()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(Pt,{theme:"primary",style:E,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(Pt,{style:E,onClick:N},{default:()=>[i.value.setting.options.cancel]})])])}}):""}}),Zd=(e,t,n)=>{const i=(v,y,C)=>({column_fixed:!!v.fixed,column_fixed_left:v.fixed!=="right",column_fixed_right:v.fixed==="right",shadow:v.fixed==="right"?C-y>2:y>0}),s=v=>v.fixed==="right"?"right":"left",o={left:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed&&y.fixed!=="right").reduce((y,C,b)=>v&&b===0?y:y+Ds(C),0),right:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>v&&b===0?y:y+Ds(C),n?_r:0)},c=(v,y,C=0)=>{const b=y[Kn.COL_UID],T=v==="right"?-1:1,N=t.filter(x=>!x.isHidden),{length:k}=N;let w=v==="right"?k*T:1,I=0;for(w;;){w=w+-1*T;const x=Math.abs(w),L=N[x],_=s(L),S=L[Kn.COL_UID];if(_===v&&b!==S){const D=Ds(L);I=I+D}if(b===S)break}return I+C},u=(v,y=!1)=>{if(!v.fixed||v.isHidden)return{};const C={left:0,right:y?_r:-1},b=s(v);return C[b]=c(b,v,C[b]),{[b]:`${C[b]}px`}},f=v=>({width:`${o[v](!1)}px`,bottom:"0px"}),d=a.computed(()=>{const v={left:!1,right:!1};return t.filter(y=>!y.isHidden&&y.fixed).map(y=>{const C=s(y),b=v[C];return v[C]=!0,{isExist:b,colPos:C,column:y}})}),{resolveClassName:h}=ye();return{fixedWrapperClass:h("table-fixed"),resolveFixedColumnStyle:u,fixedColumns:d,resolveColumnStyle:f,resolveColumnClass:i}};function $3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class YL{constructor(t,n,i,s,o,c){ke(this,"getRowHeight",(t,n)=>{const{size:i,height:s}=this.setting;return s!=null?Rt(this.setting,"height",["tbody",t,n,i]):Rt(this.props,"rowHeight",["tbody",t,n])});ke(this,"getColumnClass",(t,n)=>[{[`${this.uuid}-column-${n}`]:!0,column_fixed:!!t.fixed,column_fixed_left:!!t.fixed,column_fixed_right:t.fixed==="right"},t.className]);ke(this,"getHeadColumnClass",(t,n)=>({...this.getColumnClass(t,n),active:this.isColActive(n)}));this.props=t,this.context=n,this.reactiveProp=i,this.colgroups=s,this.plugins=new BL(t,n),this.uuid=Vi.v4(),this.events=new Map,this.styleRef=o,this.t=c,this.activeSortIndex=a.ref(-1)}get propActiveCols(){return this.reactiveProp.activeColumns}renderTableHeadSchema(){const{isShow:t=!0}=Gd(this.props);if(!t)return null;const n=i=>{var f;const{checked:s=[],size:o,height:c}=i;this.reactiveProp.setting.size=o,this.reactiveProp.setting.height=c;const u=((f=this.props.settings)==null?void 0:f.fields)||[];s.length&&this.colgroups.forEach(d=>{d.isHidden=e1(u,d,s)}),this.emitEvent(Rn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(ZL,{class:"table-head-settings",settings:this.reactiveProp.settings,columns:this.colgroups,rowHeight:this.props.rowHeight,onChange:n},null):"",a.createVNode("table",{cellpadding:0,cellspacing:0},[this.renderColGroup(),this.renderHeader()])]}renderTableBodySchema(t){var i,s;const n=a.computed(()=>this.props.emptyText===void 0?this.t.value.emptyText:this.props.emptyText);return t.length?a.createVNode("table",{cellpadding:0,cellspacing:0,"data-table-uuid":this.uuid},[this.renderColGroup(),this.renderTBody(t)]):((s=(i=this.context.slots).empty)==null?void 0:s.call(i))??a.createVNode(FL,{filterList:t,list:this.props.data,emptyText:n.value},null)}renderTableFooter(t){return a.createVNode(mh,a.mergeProps(t,{modelValue:t.current,onLimitChange:n=>this.handlePageLimitChange(n),onChange:n=>this.handlePageChange(n)}),null)}on(t,n){return this.events.has(t)||this.events.set(t,[]),this.events.get(t).push(n),this}destroy(){this.events.clear(),this.events=null}emitEvent(t,n){this.events.has(t)&&this.events.get(t).forEach(i=>{typeof i=="function"&&Reflect.apply(i,this,n)})}handlePageLimitChange(t){Object.assign(this.props.pagination,{limit:t}),this.context.emit(jt.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(jt.PAGE_VALUE_CHANGE,t)}setColumnActive(t,n=!1){const i=this.propActiveCols.find(s=>s.index===t);Object.assign(i,{active:!i.active}),n&&this.propActiveCols.filter(s=>s.index!==t&&s.active).forEach(s=>{Object.assign(s,{active:!1})})}handleColumnHeadClick(t,n){if(this.props.columnPick!=="disabled"&&(this.setColumnActive(t,this.props.columnPick==="single"),this.context.emit(jt.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=i1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=n1(n,s);this.activeSortIndex.value=t,this.emitEvent(Rn.ON_SORT_BY_CLICK,[{sortFn:o,column:n,index:t,type:s}])}}getSortCell(t,n){const i=Rt(t,["field","type"],[t,n]),s=(c,u)=>{Object.assign(this.reactiveProp.defaultSort,{[i]:u}),this.activeSortIndex.value=n,this.emitEvent(Rn.ON_SORT_BY_CLICK,[{sortFn:c,column:t,index:n,type:u}])},o=this.reactiveProp.defaultSort[i];return a.createVNode(GL,{column:t,defaultSort:o,active:this.activeSortIndex.value===n,onChange:s},null)}getFilterCell(t,n){const i=(o,c)=>{const u=(f,d)=>c(o,f,d);this.emitEvent(Rn.ON_FILTER_CLICK,[{filterFn:u,checked:o,column:t,index:n}])},s=o=>{this.context.emit(jt.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode($L,{column:t,height:this.props.headHeight,onChange:i,onFilterSave:s},null)}renderHeader(){const t=Gd(this.props),{cellFn:n}=t,i={"--row-height":`${Rt(t,"height",["thead"])}px`},s=(d,h)=>typeof n=="function"?n(d,h):Rt(d,"label",[d,h]),o=(d,h)=>{if(d.type==="selection"){const b=this.reactiveProp.rowActions.get($e.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[$e.ROW_SELECTION]:!!b},0,!0)}const m=[];d.sort&&m.push(this.getSortCell(d,h)),d.filter&&m.push(this.getFilterCell(d,h));const v=s(d,h);m.unshift(a.createVNode("span",{class:"head-text"},[v]));const y=typeof v=="string"?v:void 0,C={"has-sort":!!d.sort,"has-filter":!!d.filter};return a.createVNode(B3,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},$3(m)?m:{default:()=>[m]})},c=d=>Array.from(d.listeners.keys()).reduce((h,m)=>{const v=m.split("_").slice(-1)[0];return Object.assign(h,{[v]:y=>{d.listeners.get(m).forEach(C=>Reflect.apply(C,this,[y,d,this]))}})},{}),{resolveFixedColumnStyle:u}=Zd(this.props,this.colgroups),f=()=>{if(this.styleRef.value.hasScrollY){const d={width:`${_r+2}px`,right:"-1px"};return a.createVNode("th",{style:d,class:"column_fixed"},null)}};return a.createVNode(a.Fragment,null,[a.createVNode("thead",{style:i},[a.createVNode(md,null,{default:()=>[a.createVNode("tr",null,[this.filterColGroups.map((d,h)=>a.createVNode("th",a.mergeProps({colspan:1,rowspan:1,class:[this.getHeadColumnClass(d,h),this.getColumnCustomClass(d),d.align||this.props.headerAlign||this.props.align],style:u(d,this.styleRef.value.hasScrollY),onClick:()=>this.handleColumnHeadClick(h,d)},c(d)),[o(d,h)])),f()])]})])])}getColumnCustomClass(t,n){const i=t.className;if(i){if(typeof i=="function")return i(n);if(typeof i=="string")return i}return""}renderTBody(t){const{resolveFixedColumnStyle:n}=Zd(this.props,this.colgroups),i=t.length;return a.createVNode("tbody",null,[t.map((s,o)=>{const c=[...Ns(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...Ns(this.props.rowClass,[s,o,this]),`hover-${this.props.rowHover}`,o%2===1&&this.props.stripe?"stripe-row":""];return[a.createVNode(md,null,{default:()=>[a.createVNode("tr",{style:c,class:u,key:qm(s,this.props,o),onClick:f=>this.handleRowClick(f,s,o,t),onDblclick:f=>this.handleRowDblClick(f,s,o,t),onMouseenter:f=>this.handleRowEnter(f,s,o,t),onMouseleave:f=>this.handleRowLeave(f,s,o,t)},[this.filterColGroups.map((f,d)=>{var k;const h=[n(f),...Ns(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:v,rowspan:y}=t1(f,d,s,o),C=$e.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((k=s[C])==null?void 0:k[b])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...Ns(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[$e.ROW_EXPAND],"is-last":o+y>=i}],x=(L,_)=>{const S={event:L,row:js(s),column:r1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(_,S)};return a.createVNode("td",{class:I,style:h,colspan:v,rowspan:y,onClick:L=>x(L,jt.CELL_CLICK),onDblclick:L=>x(L,jt.CELL_DBL_CLICK)},[a.createVNode(B3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},$3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[$e.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${HL(t,i,this.props)}_expand`;return a.createVNode(md,{key:u},{default:()=>{var f,d;return[a.createVNode("tr",{class:o},[a.createVNode("td",{colspan:this.filterColGroups.length,rowspan:1},[((d=(f=this.context.slots).expandRow)==null?void 0:d.call(f,js(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(jt.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(jt.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(jt.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(jt.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[$e.ROW_EXPAND]?a.createVNode(qs,null,null):a.createVNode(io,null,null)}handleRowExpandClick(t,n,i,s,o){this.emitEvent(Rn.ON_ROW_EXPAND_CLICK,[{row:t,column:n,index:i,rows:s,e:o}])}renderCellCallbackFn(t,n,i,s){const o=El(t,Rt(n,"field",[n,t]),n),c=t[$e.ROW_INDEX],u=typeof c=="number"?c:i,f=this.props.data[u];return n.render({cell:o,data:f,row:t,column:n,index:i,rows:s})}renderCheckboxColumn(t,n,i=!1){const s=u=>{this.emitEvent(Rn.ON_ROW_CHECK,[{row:t,index:n,isAll:i,value:u}])},o=i&&!!this.reactiveProp.rowActions.get($e.ROW_SELECTION_INDETERMINATE),c=yl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(Xn,{onChange:s,disabled:!c,modelValue:t[$e.ROW_SELECTION],indeterminate:o},null)}renderExpandColumn(t,n,i,s){const o=()=>{var c,u;return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):((u=(c=this.context.slots).expandCell)==null?void 0:u.call(c,{row:t,column:n,index:i,rows:s}))??this.getExpandCell(t)};return a.createVNode("span",{class:"expand-btn-action",onClick:c=>this.handleRowExpandClick(t,n,i,s,c)},[o()])}renderCell(t,n,i,s){var u;const o=()=>{const f=El(t,Rt(n,"field",[n,t]),n);return typeof n.render=="function"?this.renderCellCallbackFn(t,n,i,s):typeof f=="object"?JSON.stringify(a.unref(f)):f},c={expand:(f,d,h,m)=>this.renderExpandColumn(f,d,h,m),selection:(f,d,h,m)=>this.renderCheckboxColumn(f,h)};return((u=c[n.type])==null?void 0:u.call(c,t,n,i,s))??o()}isColActive(t){return this.props.columnPick!=="disabled"&&this.propActiveCols.some(n=>n.index===t&&n.active)}renderColGroup(){return a.createVNode("colgroup",null,[(this.filterColGroups||[]).map((t,n)=>{const i=Ee({active:this.isColActive(n)}),s=`${QL(Ds(t))}`.replace(/px$/i,"");return a.createVNode("col",{class:i,width:s},null)})])}get filterColGroups(){return this.colgroups.filter(t=>!t.isHidden)}get setting(){return this.reactiveProp.setting}}const jc=(e,t)=>({initColumns:(s,o=!1)=>{let c=[];if(Array.isArray(s)?c=s:c=[s],o)c.forEach(u=>{const f=t.findIndex(d=>d.label===u.label&&d.field===u.field);if(o){f>=0&&t.splice(f,1);return}});else{let u=!1;c.forEach(f=>{if(f.index!==void 0&&f.index>=0){u=!0;const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0&&t.splice(d,1),t.push(f)}else{const d=t.findIndex(h=>h.label===f.label&&h.field===f.field);d>=0?t.splice(d,1,f):t.push(f)}}),u&&t.sort((f,d)=>f.index-d.index)}},getColumns:()=>{var s;return t!=null&&t.length?t:(s=e.columns)!=null&&s.length?e.columns:[]}}),G3=e=>e.columnPick!=="disabled"?e.columnPick==="multi"?Array.isArray(e.activeColumn)?e.activeColumn:hd(e.activeColumn):Array.isArray(e.activeColumn)?hd(e.activeColumn[0]):hd(e.activeColumn):[],UL=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=jc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(G3(e)),o=()=>i().map((c,u)=>({index:u,active:s.some(f=>f===u),_column:c}));return a.watchEffect(()=>{n=o();const c=G3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},KL=(e,t=!0)=>{const n="HeadColumnResize";let i=function(w){return w.MOUSE_MOVE="onMousemove",w.MOUSE_OUT="onMouseout",w.MOUSE_DOWN="onMousedown",w}({}),s=!1,o=!1,c=!1,u=0,f=null,d=0;const h=a.ref(-1e3),m=w=>{o=!1,c=!1;const I=document.body.style;I.cursor="";const x=w.clientX-u,L=(f.resizeWidth??f.calcWidth)+x,_=Number(f.minWidth);f.resizeWidth=L>_?L:_,document.removeEventListener("mouseup",m),document.removeEventListener("mousemove",y),u=0,h.value=-1e3,f=null,w.target.closest("table").querySelectorAll("th").forEach(D=>D.style.setProperty("user-select","inherit"))},v=w=>st.throttle(()=>{const I=w.clientX-u,x=(f.resizeWidth??f.calcWidth)+I;Number(f.minWidth)<x&&(h.value=w.clientX-u+d)},60),y=w=>{document.body.style.setProperty("cursor",""),v(w)()},C={[i.MOUSE_DOWN]:(w,I)=>{if(!s)return;o=!0,document.body.style.setProperty("cursor","col-resize"),f=I,u=w.clientX;const L=w.target.closest("table");d=u-L.getBoundingClientRect().left,document.addEventListener("mouseup",m),document.addEventListener("mousemove",y)},[i.MOUSE_MOVE]:(w,I)=>{o&&!c&&(c=!0);const x=w.target.closest("th");if(c&&x.style.setProperty("user-select","none"),!c){if(!x)return;const L=x.getBoundingClientRect();L.width>12&&L.right-w.pageX<8?(s=!0,x.style.setProperty("cursor","col-resize")):(x.style.setProperty("cursor",""),s=!1)}},[i.MOUSE_OUT]:(w,I)=>{const x=w.target;c||x.style.setProperty("cursor","")}},b=w=>`${n}_${w}`,T=()=>{e.forEach(w=>{w.resizable!==!1&&Object.keys(C).forEach(I=>{const x=b(I);w.listeners.has(x)||w.listeners.set(x,[]),w.listeners.get(x).push(C[I])})})},N=()=>{e.forEach(w=>{Object.keys(C).forEach(I=>{const x=b(I);if(w.listeners.has(x)){const L=w.listeners.get(x);L.length=0}})})};t&&T();const k=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:k}},XL=(e,t,n,i,s)=>{const{getColumns:o}=jc(e,t),c=a.ref(200),u=a.ref(!1),f=a.computed(()=>e.pagination&&e.data.length),d=a.computed(()=>u.value),h=a.computed(()=>Ee({[Gt("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},_L(e.border))),m=Ee({[Gt("table-head")]:!0,"has-settings":!!e.settings}),v=a.computed(()=>o()),y=Gd(e),C=a.computed(()=>({"--row-height":`${Rt(y,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),b={[Gt("table-body")]:!0},T=a.computed(()=>Ee({[Gt("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),N=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",k=()=>{if(v.value.every(P=>/^\d+\.?\d*(px)?$/ig.test(`${P.width}`))){const P=v.value.reduce((R,J)=>R+Number(`${J.width}`.replace(/px/ig,"")),0),O=u.value?_r:0;return`${P+O}px`}return"100%"},w=a.computed(()=>({minHeight:Um(e.minHeight,"auto"),width:k(),maxWidth:"100%",height:N()})),I=(P,O)=>{const R=String(P);if(/^\d+\.?\d*$/.test(R))return Number(R);if(/^\d+\.?\d*px$/ig.test(R))return Number(R.replace("px",""));if(/^\d+\.?\d*%$/ig.test(R)&&typeof O=="number"){const J=Number(R.replace("%",""));return O*J/100}return O},x=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),L=()=>e.showHead?I(e.headHeight,Pa):0,_=()=>{const P=I(e.height,c.value),O=L(),R=I(e.minHeight,c.value),J=e.pagination&&e.data.length?e.paginationHeight:0,G=P-O-J,ie=e.height!=="auto"?`${G}px`:!1,ge=R-O-J,ue=I(e.maxHeight,void 0),ae=typeof ue=="number"?`${ue-O-J}px`:!1;Object.assign(x,{display:s!=null&&s.length?"block":!1,"min-height":`${ge}px`,height:ie,maxHeight:ae})};a.onMounted(()=>{S(n==null?void 0:n.value)});const S=P=>{if(P){const{height:O}=P.parentElement.getBoundingClientRect();c.value=O,_(),D(P)}},D=P=>{if(!P)return;const O=e.virtualEnabled?`.${Gt("virtual-section")}`:`.${Gt("table-body-content")}`,R=P.querySelector(`.${Gt("table-body")}`);u.value=WL(R,O,0)};return{tableClass:h,headClass:m,contentClass:b,footerClass:T,wrapperStyle:w,contentStyle:x,headStyle:C,resetTableHeight:S,updateBorderClass:D,getColumnsWidthOffsetWidth:()=>{let P=0;return u.value&&(P=P+_r),e.border.includes(jl.OUTER)&&!e.border.includes(jl.NONE)&&(P=P+2),P},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},qL=(e,t)=>{var te,oe;const n=a.reactive([]),{getColumns:i}=jc(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let Q=Cr;return W.sort&&(Q=Q+18),W.filter&&(Q=Q+28),Q},o=a.computed(()=>i()),c=W=>{var ee,fe;const Q=(W==null?void 0:W.checked)||((ee=e.settings)==null?void 0:ee.checked)||[],$=(W==null?void 0:W.fields)||((fe=e.settings)==null?void 0:fe.fields)||[];n.length=0,n.push(...o.value.map(K=>({...K,calcWidth:null,resizeWidth:null,minWidth:s(K),listeners:new Map,isHidden:e1($,K,Q),[Kn.COL_UID]:Vi.v4(),[Kn.COL_SOURCE_DATA]:K})))};typeof e.settings=="object"&&c(e.settings);const{dragOffsetXStyle:u,dragOffsetX:f,resetResizeEvents:d,registerResizeEvent:h}=KL(n,!0),{activeColumns:m}=UL(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const v=st.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{v()},{immediate:!0,deep:!0});const y=e.columns.reduce((W,Q,$)=>{const ee=Rt(Q,["field","type"],[Q,$]),fe=a1(Q.sort);return fe?{...W||{},[ee]:fe==null?void 0:fe.value}:W},null),C=a.reactive({rowActions:new Map,scrollTranslateY:0,scrollTranslateX:0,pos:{bottom:1},activeColumns:m,settings:e.settings,setting:{size:(te=e.settings)==null?void 0:te.size,height:vl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:y||e.defaultSort}),b=W=>{var Q;return C.rowActions.has(W)?(Q=C.rowActions.get(W))==null?void 0:Q.isExpand:!1},T=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(W,Q=void 0)=>{const $=W[$e.ROW_UID],ee=typeof Q=="boolean"?Q:!b($);C.rowActions.set($,Object.assign({},C.rowActions.get($)??{},{isExpand:ee})),ae()},k=()=>C.rowActions.has($e.ROW_SELECTION_ALL)?C.rowActions.get($e.ROW_SELECTION_ALL):e.selectionKey?O.every(W=>E(W)):!1,w=W=>{const Q=W[$e.ROW_UID],{isSelected:$=!1}=C.rowActions.get(Q)||{};return $},I=(W=w)=>{let Q=!1,$=!1;O.forEach(ee=>{const fe=W(ee);!Q&&!fe&&(Q=!0),!$&&fe&&($=!0)}),C.rowActions.set($e.ROW_SELECTION_INDETERMINATE,$&&Q),C.rowActions.set($e.ROW_SELECTION_ALL,$&&!Q)},x=()=>e.columns.some(W=>W.type==="selection"),L=()=>{x()&&I(W=>E(W))},_=(W=void 0)=>{const Q=typeof W=="boolean"?W:!k();C.rowActions.set($e.ROW_SELECTION_ALL,Q),C.rowActions.set($e.ROW_SELECTION_INDETERMINATE,!1),O.forEach(($,ee)=>{if(yl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[$e.ROW_UID],K=Object.assign({},C.rowActions.get(fe)??{},{isSelected:Q});C.rowActions.set(fe,K)}}),I(),ae(Q),Z(null,W,!0)},S=()=>{_(!1)},D=(W,Q)=>{const $=W[$e.ROW_UID];if($){const ee=typeof Q=="boolean"?Q:!P(W,$),fe=Object.assign({},C.rowActions.get($)??{},{isSelected:ee});C.rowActions.set($,fe),Q||C.rowActions.set($e.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,Q,!1)}},E=(W,Q=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?st.get(W,e.selectionKey):Q(W),P=(W,Q,$)=>E(W,()=>{var fe;const ee=Q===void 0?W[$e.ROW_UID]:Q;return yl(e,{row:W,index:$,isCheckAll:!1})&&k()?!0:C.rowActions.has(ee)?(fe=C.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),O=a.reactive([]),R=a.computed(()=>n.some(W=>typeof W.rowspan=="function"||/^\d$/.test(`${W.rowspan}`)||typeof W.colspan=="function"||/^\d$/.test(`${W.colspan}`))),J=a.computed(()=>n.some(W=>W.type==="selection")),G=a.computed(()=>n.some(W=>W.type==="expand")),ie=a.computed(()=>n.some(W=>W.type==="index")),ge=(W=!1)=>{let Q=null;const $={},ee=e.data.map(fe=>({[$e.ROW_UID]:Vi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const be=Xm(K,e,de);Q=be;const Ie={...K,[$e.ROW_UID]:K[$e.ROW_UID]||be,[$e.ROW_SOURCE_DATA]:{...K}};if(R.value){const Se=me(K,be,de,$,Q);Object.assign(Ie,{[$e.ROW_SKIP_CFG]:Se})}return J.value&&Object.assign(Ie,{[$e.ROW_SELECTION]:P(K,be,de)}),ie.value&&Object.assign(Ie,{[$e.ROW_INDEX]:de}),G.value&&Object.assign(Ie,{[$e.ROW_EXPAND]:W?b(be):!1}),Ie});O.length=0,O.push(...fe),J.value&&L();return}O.length=0,O.push(...ee)},ue=(W,Q,$,ee)=>{const fe=P($,$[$e.ROW_UID],ee);return W&&typeof Q=="boolean"?Q:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let Q=null;const $={};O.forEach((ee,fe)=>{const K=ee[$e.ROW_UID];if(G.value&&Object.assign(ee,{[$e.ROW_EXPAND]:b(ee[$e.ROW_UID])}),R.value){const de=me(ee,K,fe,$,Q);Q=ee[$e.ROW_UID],Object.assign(ee,{[$e.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[$e.ROW_INDEX]:fe}),J.value){const de=yl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[$e.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},me=(W,Q,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[Q]||(ee[Q]={}),n.forEach((be,Ie)=>{var Le;const{colspan:Se,rowspan:Ve}=t1(be,Ie,W,$),Pe=be[Kn.COL_UID],ce=((Le=de[Pe])==null?void 0:Le.skipRowLen)??0,Ce={[Pe]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(Ce[Pe].skipColLen=K,Ce[Pe].skipCol=!0,K=K-1),ce>1?(Ce[Pe].skipRowLen=ce-1,Ce[Pe].skipRow=!0):Ve>1&&(Ce[Pe].skipRowLen=Ve,Ce[Pe].skipRow=!1),Se>1&&(Ce[Pe].skipColLen=Se,K=Se-1),Object.assign(ee[Q],{...Ce})}),ee[Q]},B=st.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,Q,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{st.has(ee,e.selectionKey)&&st.set(ee,e.selectionKey,!!Q)});else if(st.has(W,e.selectionKey)){const ee=e.data.find(fe=>st.get(fe,e.rowKey)===st.get(W,e.rowKey));st.set(ee,e.selectionKey,!!Q)}}},{fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,fixedWrapperClass:X}=Zd(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:O,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:V,resolveColumnClass:Y,initIndexData:ge,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:S,toggleAllSelection:_,toggleRowSelection:D,getSelection:()=>O.filter(W=>P(W)),clearSort:T}},eT=a.defineComponent({name:"Table",props:uL,emits:iL,setup(e,t){const n=ht("table");let i=null,s=null,o=null;const c=new fL,u=a.reactive([]),{initColumns:f}=jc(e,u);a.provide(Rm,f),a.provide(Jm,c);const d=a.ref(),h=a.ref(),m=a.ref(0),{colgroups:v,dragOffsetXStyle:y,dragOffsetX:C,reactiveSchema:b,indexData:T,fixedColumns:N,resolveColumnStyle:k,resolveColumnClass:w,setRowExpand:I,initIndexData:x,fixedWrapperClass:L,clearSelection:_,toggleAllSelection:S,toggleRowSelection:D,getSelection:E,clearSort:P,updateColGroups:O}=qL(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=hL(e,T),{tableClass:ge,headClass:ue,contentClass:ae,footerClass:me,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:V,updateBorderClass:Y,resetTableHeight:X,getColumnsWidthOffsetWidth:re,hasFooter:te}=XL(e,u,d,b,R),{resolveClassName:oe}=ye(),W=a.computed(()=>({hasScrollY:V.value})),Q=new YL(e,t,b,v,W,n),$=()=>{const He=d.value.querySelector(`.${oe("table-body-content")}`),Ae=He.querySelector("table");if(Ae){const Be=Ae.scrollWidth,ot=He.clientWidth;m.value=Be-ot}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{x(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{X(d.value),Y(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const He=re();gd(d.value,v,20,He),$()}}),Q.on(Rn.ON_SORT_BY_CLICK,He=>{const{sortFn:Ae,column:Be,index:ot,type:qe}=He;typeof Ae=="function"&&(i=Ae,s=Be,Object.assign(s,{[Kn.SORT_TYPE]:qe}),G(o,i,s)),t.emit(jt.COLUMN_SORT,{column:a.unref(Be[Kn.COL_SOURCE_DATA]),index:ot,type:qe})}).on(Rn.ON_FILTER_CLICK,He=>{const{filterFn:Ae,checked:Be,column:ot,index:qe}=He;typeof Ae=="function"&&(o=Ae,G(o,i,s)),t.emit(jt.COLUMN_FILTER,{checked:Be,column:a.unref(ot[Kn.COL_SOURCE_DATA]),index:qe})}).on(Rn.ON_SETTING_CHANGE,He=>{const{checked:Ae=[],size:Be,height:ot,fields:qe}=He;a.nextTick(()=>{O({checked:Ae,fields:qe}),Y(d.value);const mt=re();Ae.length&&gd(d.value,v,Cr,mt),t.emit(jt.SETTING_CHANGE,{checked:Ae,size:Be,height:ot,fields:qe})})}).on(Rn.ON_ROW_EXPAND_CLICK,He=>{const{row:Ae,column:Be,index:ot,rows:qe,e:mt}=He;t.emit(jt.ROW_EXPAND_CLICK,{row:js(Ae),column:r1(Be),index:ot,rows:qe,e:mt}),I(Ae,!Ae[$e.ROW_EXPAND])}).on(Rn.ON_ROW_CHECK,({row:He,isAll:Ae,index:Be,value:ot})=>{Ae?(S(ot),t.emit(jt.ROW_SELECT_ALL,{checked:ot,data:e.data})):(D(He,ot),t.emit(jt.ROW_SELECT,{row:js(He),index:Be,checked:ot,data:e.data})),t.emit(jt.ROW_SELECT_CHANGE,{row:js(He),isAll:Ae,index:Be,checked:ot,data:e.data})});const ee=He=>{const Ae=b.pos.bottom??0,Be=He[1],{translateX:ot,translateY:qe,pos:mt={}}=Be;b.scrollTranslateY=qe,b.scrollTranslateX=ot,b.pos=mt;const{bottom:Ze}=mt;Ze<=2&&Ae>Ze&&Zs(60,()=>{t.emit(jt.SCROLL_BOTTOM,{...mt,translateX:ot,translateY:qe})},!0)(),$()},fe=(He={left:0,top:0})=>{var Ae,Be;(Be=(Ae=h.value)==null?void 0:Ae.scrollTo)==null||Be.call(Ae,He)};a.onMounted(()=>{if(e.observerResize){let He=Km(d.value,()=>{if(!d.value)return;(e.height==="100%"||e.height==="auto")&&X(d.value),Y(d.value);const Ae=re();gd(d.value,v,20,Ae)},180,!0,e.resizerWay);He.start(),a.onBeforeUnmount(()=>{He.disconnect(),He=null})}}),a.onBeforeUnmount(()=>{Q.destroy()});const K=()=>d.value;t.expose({setRowExpand:I,clearSelection:_,toggleAllSelection:S,toggleRowSelection:D,getSelection:E,clearSort:P,scrollTo:fe,getRoot:K});const de=a.computed(()=>({...ae,"__is-empty":!R.length})),be=a.computed(()=>({[oe("table-body-content")]:!0,"with-virtual-render":e.virtualEnabled})),Ie={column_drag_line:!0,"offset-x":!0},Se=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),Ve={"scroll-loading":!0,_bottom:!0},Pe=a.computed(()=>({[oe("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),ce={zIndex:-1,width:0,height:0,display:"none"},Ce=a.computed(()=>({"--footer-height":te.value?`${e.paginationHeight}px`:"0"})),Le=a.computed(()=>({right:V.value?`${_r}px`:0,...Ce.value})),{renderScrollLoading:Re}=gL(e,t),at=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),nt=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),ct=()=>t.slots.prepend?a.createVNode("div",{style:nt.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var He,Ae;return a.createVNode("div",{class:ge.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[Q.renderTableHeadSchema()]),a.createVNode(Gr,a.mergeProps({ref:h,lineHeight:Q.getRowHeight,class:de.value,style:Z,list:R},at.value,{contentClassName:be.value,onContentScroll:ee,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>ct(),default:Be=>Q.renderTableBodySchema(Be.data||R),afterSection:()=>a.createVNode("div",{class:Pe.value},null)}),a.createVNode("div",{class:L,style:Le.value},[N.value.map(({isExist:Be,colPos:ot,column:qe})=>Be?"":a.createVNode("div",{class:w(qe,b.scrollTranslateX,m.value),style:k(ot)},null)),a.createVNode("div",{class:Ie,style:Se.value},null),a.createVNode("div",{class:Ve},[Re()])]),a.createVNode("div",{class:me.value,style:Ce.value},[te.value&&Q.renderTableFooter(J.value)]),a.createVNode("div",{style:ce},[(Ae=(He=t.slots).default)==null?void 0:Ae.call(He)])])}}}),s1=Xt(eT,{Column:dL}),gr=12;function tT(e){const t=a.reactive({curPage:1,totalSize:0,totalPage:0,pageSize:e,isPageLoading:!1,curPageList:[],renderListPaged:[]});return{pageState:t,initPage:(s=[])=>{t.curPage=1,t.totalSize=s.length,t.totalPage=Math.ceil(t.totalSize/t.pageSize)||1;const o=[];if(t.pageSize>0)for(let c=0;c<t.totalSize;c+=t.pageSize)o.push(s.slice(c,c+t.pageSize));t.renderListPaged.splice(0,t.renderListPaged.length,...o),t.curPageList.splice(0,t.curPageList.length,...t.renderListPaged[t.curPage-1]||[])},pageChange:s=>{t.curPage=s,t.curPageList.splice(t.curPageList.length,0,...t.renderListPaged[t.curPage-1]||[]),t.isPageLoading=!1}}}function nT(e){const{useGroup:t,saveKey:n,displayKey:i,list:s}=a.toRefs(e),o=a.ref([]),c=a.ref({});return a.watch([t,n,i,s],()=>{o.value=[];let u=a.markRaw(s.value);t.value&&(u=u.reduce((f,d)=>{let h=[];return d.children&&(h=d.children.map(m=>({group:{groupId:d[n.value],groupName:d[i.value]},...m}))),f.concat(h)},[])),o.value=u,c.value=u.reduce((f,d)=>(f[d[n.value]]=d,f),{})},{immediate:!0,deep:!0}),{flatList:o,saveKeyMap:c}}const Z3=e=>{const t=e.length;let n=0;for(let i=0;i<t;i++)e.charCodeAt(i)&65280&&(n+=1),n+=1;return n},o1=(e,t,n)=>{a.watch([n,t],()=>{s()},{flush:"post"});const i=a.ref(null),s=()=>{t.value&&(i.value=null,setTimeout(()=>{const o=Array.from(e.value.querySelectorAll(".tag-item")),c=o.findIndex((u,f)=>f?o[f-1].offsetTop!==u.offsetTop:!1);i.value=c>0?c-1:null}))};return{overflowTagIndex:i}},Y3=a.defineComponent({name:"ListTagRender",props:{node:p.object,searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]),displayKey:p.string,searchKeyword:p.string,tpl:{type:Function}},render(){const{resolveClassName:e}=ye(),t=i=>{if(this.searchKeyword){const s=new RegExp(`(${this.searchKeyword})`,"i");return i.replace(s,'<strong class="highlight-text">$1</strong>')}return i};if(this.tpl)return this.tpl(this.node,t,a.h,this);const n=this.node[this.displayKey];return a.createVNode("div",{class:`${e("selector-node")}`},[a.createVNode("span",{class:"text",innerHTML:t(n)},[n])])}}),iT=()=>({modelValue:p.arrayOf(p.string).def([]),placeholder:p.string.def(""),list:p.arrayOf(p.object).def([]),disabled:p.bool.def(!1),tooltipKey:p.string.def(""),saveKey:p.string.def("id"),displayKey:p.string.def("name"),hasDeleteIcon:p.bool.def(!1),clearable:p.bool.def(!0),trigger:ze("treeTriggerType",{}).def("search"),searchKey:p.oneOfType([p.string,p.arrayOf(p.string)]).def("name"),useGroup:p.bool.def(!1),allowCreate:p.bool.def(!1),maxData:p.number.def(-1),maxResult:p.number.def(10),contentMaxHeight:p.number.def(300),contentWidth:p.number.def(190),separator:p.string.def(""),allowNextFocus:p.bool.def(!0),allowAutoMatch:p.bool.def(!1),showClearOnlyHover:p.bool.def(!1),isAsyncList:p.bool.def(!1),leftSpace:p.number.def(0),createTagValidator:{type:Function},filterCallback:{type:Function},tagTpl:{type:Function},tpl:{type:Function},pasteFn:{type:Function},withValidate:{type:Boolean,default:!0},popoverProps:{type:Object,default:()=>({})},collapseTags:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}}),aT=a.defineComponent({name:"TagRender",directives:{bkTooltips:$r},props:{node:p.object,displayKey:p.string,tpl:{type:Function},hasTips:{type:Boolean,default:!1},tagOverflowTips:{type:Object,default:()=>({})}},setup(e){const t=a.ref(),n=a.ref(!1),i=a.computed(()=>({boundary:"window",theme:"light",distance:12,content:e.node[e.displayKey],disabled:e.hasTips||!n.value,...e.tagOverflowTips}));return a.onMounted(()=>{n.value=Yb(t.value)}),{overflowTips:i,tagRef:t}},render(){return this.tpl?this.tpl(this.node,a.h,this):a.withDirectives(a.createVNode("div",{class:"tag",ref:"tagRef"},[a.createVNode("span",{class:"text"},[this.node[this.displayKey]])]),[[a.resolveDirective("bk-tooltips"),this.overflowTips]])}}),rT=a.defineComponent({name:"TagInput",directives:{bkTooltips:$r},props:iT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ht("tagInput"),s=a.reactive({isEdit:!1,isHover:!1,focusItemIndex:e.allowCreate?-1:0}),o=a.reactive({isShow:!1,width:190,offset:{mainAxis:4,crossAxis:0},...e.popoverProps}),{resolveClassName:c}=ye(),{maxResult:u}=a.toRefs(e),{pageState:f,initPage:d,pageChange:h}=tT(u),m=a.ref(""),v=a.ref(null),y=a.ref(null),C=a.ref(null),b=a.ref(null),T=a.ref(null),N=a.ref(null),k=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>S.selectedTagList.length===0&&m.value===""&&!s.isEdit),x=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&S.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),_=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),S=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>S.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:E,saveKeyMap:P}=nT(e),O=a.computed(()=>{if(e.useGroup){const ce={};return f.curPageList.forEach((Ce,Le)=>{Ce.__index__=Le,ce[Ce.group.groupId]||(ce[Ce.group.groupId]={id:Ce.group.groupId,name:Ce.group.groupName,children:[]}),ce[Ce.group.groupId].children.push(Ce)}),Object.keys(ce).map(Ce=>ce[Ce])}return f.curPageList});a.watch([()=>E.value],()=>{a.nextTick(()=>{ge()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var Ce;me(D.value,ce)||(a.nextTick(()=>{ge()}),e.withValidate&&((Ce=n==null?void 0:n.validate)==null||Ce.call(n,"change")))}),a.watch(m,st.debounce(()=>{const ce=f.curPageList.length!==0,{value:Ce}=m;Ce!==""&&ce||Ce===""&&e.trigger==="focus"&&ce?o.isShow=!0:(e.trigger!=="focus"||!ce)&&(o.isShow=!1)},150)),a.watch(()=>o.isShow,ce=>{R(),ce&&T.value&&(a.nextTick(()=>{T.value.scrollTop=0}),T.value.removeEventListener("scroll",J),T.value.addEventListener("scroll",J))}),a.onMounted(()=>{ge()});const R=()=>{var ce;o.offset.crossAxis=w.value?0:(ce=b.value)==null?void 0:ce.offsetLeft},J=()=>{if(f.isPageLoading||T.value.scrollTop===0)return;const{scrollTop:ce,offsetHeight:Ce,scrollHeight:Le}=T.value;if(ce+Ce>=Le){const Re=f.curPage+1;Re<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Re)},500))}},G=()=>{var Ce;return Array.from(((Ce=C.value)==null?void 0:Ce.childNodes)||[]).filter(Le=>![Node.TEXT_NODE,Node.COMMENT_NODE].includes(Le.nodeType))},ie=ce=>{if(!e.disabled){if(ce!=null&&ce.target){const{className:Ce}=ce.target;(Ce.indexOf(`${c("tag-input-trigger")}`)>-1||Ce.indexOf("tag-list")>-1)&&C.value.appendChild(b.value)}clearTimeout(N.value),w.value&&D.value.length&&(S.tagListCache=[...D.value],S.selectedTagListCache=[...S.selectedTagList],m.value=S.selectedTagListCache[0][e.saveKey],Se(S.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var Ce;(Ce=v.value)==null||Ce.focus(),e.trigger==="focus"&&S.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},ge=()=>{const{saveKey:ce,modelValue:Ce,displayKey:Le,allowCreate:Re,trigger:at,isAsyncList:nt}=e;if(S.selectedTagList=[],S.localList=E.value,Ce.length){const ct={};S.selectedTagList=Ce.map(He=>{const Ae=P.value[He];return ct[He]=1,!Ae&&Re?{[ce]:He,[Le]:He}:Ae}).filter(He=>He),w.value||(S.localList=S.localList.filter(He=>!ct[He[ce]]))}if(nt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}at==="focus"&&ue()},ue=(ce="")=>{const{searchKey:Ce,filterCallback:Le}=e,Re=ce.toLowerCase().trim();if(Re===""){d(S.localList);return}let at=[];typeof Le=="function"?at=Le(Re,Ce,S.localList)||[]:Array.isArray(Ce)?at=S.localList.filter(nt=>Ce.some(ct=>nt[ct].toLowerCase().indexOf(Re)>-1)):at=S.localList.filter(nt=>nt[Ce].toLowerCase().indexOf(Re)>-1),d(at)},ae=(ce,Ce)=>{const Le={[`${c("selector-actived")}`]:!0,[`${c("selector-selected")}`]:D.value.includes(ce[e.saveKey])};return e.useGroup?Le[`${c("selector-actived")}`]=ce.__index__===s.focusItemIndex:Le[`${c("selector-actived")}`]=Ce===s.focusItemIndex,Le};function me(ce,Ce){return ce.length!==Ce.length?!1:Ce.every((Le,Re)=>ce[Re]===Le)}const B=()=>{S.tagListCache=[],S.selectedTagListCache=[],S.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const Ce=G().findIndex(({id:Le})=>Le==="tagInputItem");return Ce>=0?Ce:0},V=(ce,Ce,Le=!1)=>{if(!Ce||!ce)return;let Re=Ce;Le&&(Re=Ce.nextElementSibling||null),Ce.parentNode.insertBefore(ce,Re)},Y=ce=>{const{maxData:Ce,trigger:Le,allowCreate:Re}=e;if(Ce===-1||Ce>D.value.length){const{value:at}=ce!=null&&ce.target?ce.target:m,nt=Z3(at);nt?(ue(at),v.value.style.width=`${nt*gr}px`):Le==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Re?-1:0,t("input",m.value)},X=()=>{var ce;o.width=w.value?(ce=y.value)==null?void 0:ce.clientWidth:e.contentWidth,t("focus")},re=()=>{N.value=setTimeout(()=>{var Ce;const ce=m.value;if(Z(),s.isEdit=!1,w.value){const[Le]=S.tagListCache;ce&&ce===Le&&S.selectedTagListCache.length?Ie(S.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Le=f.curPageList.find(Re=>Array.isArray(e.searchKey)?e.searchKey.map(nt=>Re[nt]).includes(ce):Re[e.searchKey]===ce);Le?te(Le,"select"):e.allowCreate&&te(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(Ce=n==null?void 0:n.validate)==null||Ce.call(n,"blur")},200)},te=(ce,Ce,Le)=>{Le==null||Le.stopPropagation(),!(!ce||ce.disabled)&&(w.value&&B(),Ie(ce,Ce),W("select"),Z(),o.isShow=!1)},oe=(ce,Ce,Le)=>{Le==null||Le.stopPropagation(),Se(ce,Ce),Z(),W("remove",ce),v.value.style.width=`${gr}px`},W=(ce,Ce)=>{t(ce,Ce),t("update:modelValue",D.value),t("change",D.value)},Q=ce=>{ce.stopPropagation();const Ce=S.selectedTagList;S.selectedTagList=[];const Le=Ce.filter(Re=>P.value[Re[e.saveKey]]);(e.allowCreate&&Le.length!==0||!e.allowCreate)&&!w.value&&S.localList.push(...Le),W("removeAll")},$=()=>{const ce={height:T.value.clientHeight,yAxis:T.value.getBoundingClientRect().y};a.nextTick(()=>{const Ce=T.value.querySelector(`.${c("selector-actived")}`);if(!Ce)return;const Le={height:Ce.clientHeight,yAxis:Ce.getBoundingClientRect().y};Le.yAxis<ce.yAxis&&(T.value.scrollTop=T.value.scrollTop-(ce.yAxis-Le.yAxis));const Re=Le.yAxis+Le.height-ce.yAxis;Re>ce.height&&(T.value.scrollTop=T.value.scrollTop+Re-ce.height)})},ee=(ce,Ce)=>{const Le=G();V(b.value,Le[ce-1]),S.selectedTagList.splice(ce-1,1),ie();const Re=P.value[Ce[e.saveKey]];(e.allowCreate&&Re||!e.allowCreate)&&!w.value&&S.localList.push(Ce),v.value=`${gr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let Ce;const Le=ce.target.value,Re=Z3(Le),at=H(),nt=G();switch(ce.code){case"ArrowUp":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex-1,s.focusItemIndex=s.focusItemIndex<0?-1:s.focusItemIndex,s.focusItemIndex===-1&&(s.focusItemIndex=f.curPageList.length-1),$();break;case"ArrowDown":if(ce.preventDefault(),!o.isShow)return;s.focusItemIndex=s.focusItemIndex+1,s.focusItemIndex=s.focusItemIndex>f.curPageList.length-1?f.curPageList.length:s.focusItemIndex,s.focusItemIndex===f.curPageList.length&&(s.focusItemIndex=0),$();break;case"ArrowLeft":if(s.isEdit=!0,!Re){if(at<1)return;V(b.value,nt[at-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Re){if(at===nt.length-1)return;V(nt[at+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?te(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&te(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":at!==0&&!m.value&&(Ce=S.selectedTagList[at-1],ee(at,Ce));break}},K=ce=>{const Ce=[],Le=ce.split(";"),Re=/^[a-zA-Z][a-zA-Z_]*/g;return Le.forEach(at=>{const nt=at.match(Re);if(nt){const ct=nt.join("");Ce.push({[e.saveKey]:ct,[e.displayKey]:ct})}}),Ce},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:Ce,saveKey:Le,displayKey:Re,pasteFn:at,allowCreate:nt}=e,ct=ce.clipboardData.getData("text");let Ae=(at?at(ct):K(ct)).map(Be=>Be[Le]);if(Ae.length){const Be=G(),ot=H(),qe=S.localList.map(Ze=>Ze[Le]);if(Ae=Ae.filter(Ze=>{const Qt=(Ze==null?void 0:Ze.trim())&&!D.value.includes(Ze);return nt?Qt:Qt&&qe.includes(Ze)}),Ce!==-1){const Ze=S.selectedTagList.length;if(Ze<Ce){const Qt=Ce-Ze;Ae.length>Qt&&(Ae=[...Ae.slice(0,Qt)])}else Ae=[]}const mt=nt?Ae.map(Ze=>S.localList.find(Hi=>Hi[Le]===Ze)??{[Le]:Ze,[Re]:Ze}):S.localList.filter(Ze=>Ae.includes(Ze[Le]));Ae.length&&(S.selectedTagList.splice(ot,0,...mt),V(b.value,Be[ot]),v.value.style.width=`${gr}px`,S.localList=S.localList.filter(Ze=>!Ae.includes(Ze[Le])),W("select"),ie())}},be=ce=>{e.disabled||(V(b.value,ce.currentTarget,!0),v.value.style.width=`${gr}px`,o.isShow&&R())},Ie=(ce,Ce)=>{if(S.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Le,saveKey:Re,displayKey:at,createTagValidator:nt}=e,ct=H();let He=1,Ae=!1,Be;const ot=qe=>typeof nt=="function"?nt(qe):!0;if(Ce==="custom")if(Le){let qe=ce.split(Le);qe=qe.filter(Ze=>(Ze==null?void 0:Ze.trim())&&!D.value.includes(Ze)&&ot(Ze));const mt=qe.map(Ze=>P.value[Ze]||{[Re]:Ze,[at]:Ze});qe.length&&(S.selectedTagList.splice(ct,0,...mt),He=mt.length,Ae=!0)}else{const qe=typeof ce=="object";if(Be=qe?ce[Re]:ce.trim(),Be=Be.replace(/\s+/g,""),Be!==void 0&&!D.value.includes(Be)&&ot(Be)){const mt=P.value[Be]||(qe?ce:{[Re]:Be,[at]:Be});S.selectedTagList.splice(ct,0,mt),Ae=!0}}else ce&&(Be=ce[Re],Be!==void 0&&!D.value.includes(Be)&&(S.selectedTagList.splice(ct,0,ce),Ae=!0));Ae&&a.nextTick(()=>{for(let qe=1;qe<=He;qe++){const Ze=G()[ct+qe];V(Ze,b.value)}if(v.value.style.width=`${gr}px`,!w.value){e.allowNextFocus&&ie();const qe=D.value.reduce((mt,Ze)=>(mt[Ze]=1,mt),{});S.localList=S.localList.filter(mt=>!qe[mt[Re]])}})},Se=(ce,Ce)=>{S.selectedTagList.splice(Ce,1);const Le=P.value[ce[e.saveKey]];(e.allowCreate&&Le||!e.allowCreate)&&!w.value&&S.localList.push(ce)},Ve=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Pe}=o1(y,Ve,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(S),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:x,curInputValue:m,renderList:O,showTagClose:k,tagInputRef:v,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:T,triggerClass:_,overflowTagIndex:Pe,localCollapseTags:Ve,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:te,handleTagRemove:oe,handleClear:Q,tagFocus:be,handleKeydown:fe,handlePaste:de,resolveClassName:c}},render(){return a.createVNode("div",{class:`${this.resolveClassName("tag-input")}`,ref:"bkTagSelectorRef",onClick:this.focusInputTrigger,onMouseenter:()=>this.isHover=!0,onMouseleave:()=>this.isHover=!1},[a.createVNode(Kt,a.mergeProps({theme:`light ${this.resolveClassName("tag-input-popover-content")}`,trigger:"manual",placement:"bottom-start",arrow:!1},this.popoverProps),{default:()=>{var e,t;return a.createVNode("div",{class:this.triggerClass},[a.createVNode("ul",{class:"tag-list",ref:"tagListRef",style:{marginLeft:`${this.leftSpace}px`}},[this.selectedTagList.map((n,i)=>{const s={boundary:"window",theme:"light",distance:12,content:n[this.tooltipKey],disabled:!this.tooltipKey},o=this.localCollapseTags&&this.overflowTagIndex&&i>=this.overflowTagIndex;return a.withDirectives(a.createVNode("li",{class:"tag-item",style:{display:o?"none":""},onClick:this.tagFocus},[a.createVNode(aT,{node:n,tpl:this.tagTpl,displayKey:this.displayKey,hasTips:!!this.tooltipKey,tagOverflowTips:this.tagOverflowTips},null),this.showTagClose?a.createVNode(mn,{class:"remove-tag",onClick:this.handleTagRemove.bind(this,n,i)},null):null]),[[a.resolveDirective("bk-tooltips"),s]])}),a.withDirectives(a.createVNode("li",{ref:"tagInputItemRef",id:"tagInputItem",class:"tag-input-item",role:"input"},[a.withDirectives(a.createVNode("input",{type:"text",class:"tag-input",ref:"tagInputRef","onUpdate:modelValue":n=>this.curInputValue=n,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeydown,onPaste:this.handlePaste},null),[[a.vModelText,this.curInputValue]])]),[[a.vShow,this.isEdit]]),!!this.overflowTagIndex&&this.localCollapseTags&&a.createVNode("li",{class:"tag-item"},[a.createVNode("div",{class:"tag"},[a.createVNode("span",{class:"text"},[a.createTextVNode("+"),this.selectedTagList.length-this.overflowTagIndex])])])]),a.withDirectives(a.createVNode("p",{class:"placeholder"},[this.placeholderText]),[[a.vShow,this.isShowPlaceholder]]),((t=(e=this.$slots)==null?void 0:e.suffix)==null?void 0:t.call(e))??(this.isShowClear&&a.createVNode(pn,{class:"clear-icon",onClick:this.handleClear},null))])},content:()=>a.createVNode("div",{class:`${this.resolveClassName("selector-list")}`},[a.createVNode("ul",{ref:"selectorListRef",style:{"max-height":`${this.contentMaxHeight}px`},class:"outside-ul"},[this.renderList.map((e,t)=>this.useGroup?a.createVNode("li",{class:`${this.resolveClassName("selector-group-item")}`},[a.createVNode("span",{class:"group-name"},[e.name,a.createTextVNode(" ("),e.children.length,a.createTextVNode(")")]),a.createVNode("ul",{class:`${this.resolveClassName("selector-group-list-item")}`},[e.children.map((n,i)=>a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:n.disabled},this.activeClass(n,i)],onClick:this.handleTagSelected.bind(this,n,"select")},[a.createVNode(Y3,{node:n,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)]))])]):a.createVNode("li",{class:[`${this.resolveClassName("selector-list-item")}`,{disabled:e.disabled},this.activeClass(e,t)],onClick:this.handleTagSelected.bind(this,e,"select")},[a.createVNode(Y3,{node:e,displayKey:this.displayKey,tpl:this.tpl,searchKey:this.searchKey,searchKeyword:this.curInputValue},null)])),this.isPageLoading?a.createVNode("li",{class:`${this.resolveClassName("selector-list-item")} loading`},[a.createVNode(ca,{theme:"primary",size:Qa.Small},null)]):null])])})])}}),l1=Ue(rT),sT={direction:Ig(),align:Dd().def(Ll.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:Lg()},oT=a.defineComponent({name:"Divider",props:sT,render(){const e=()=>this.direction==="vertical"?{borderRight:`${this.width}px ${this.type} ${this.color}`}:{borderBottom:`${this.width}px ${this.type} ${this.color}`},{resolveClassName:t}=ye();let n;return this.$slots.default&&(n=a.createVNode("div",{class:[t("divider-info"),t(`divider-info-${this.align}`)]},[this.$slots.default()])),a.createVNode("div",{class:[t("divider"),t(`divider-${this.direction}`)],style:e()},[n])}}),c1=Ue(oT);var Pl=(e=>(e.CARD="card",e.BORDER_CARD="border-card",e.UNBORDER_CARD="unborder-card",e.CARD_TAB="card-tab",e.CARD_GRID="card-grid",e))(Pl||{}),Os=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(Os||{});const u1=ze("position",{}).def("top");var d1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(d1||{});const f1=ze("sortType",{}).def("replace"),lT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},cT={name:p.oneOfType([p.number,p.string]).def(""),label:p.string||p.func,tips:p.string,closable:p.bool,visible:p.bool.def(!0),disabled:p.bool,sortable:p.bool,renderDirective:Mf(),panel:p.string||p.func},uT={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),tabPosition:u1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:f1,labelHeight:p.number.def(50),scrollStep:p.number.def(200),extCls:p.string.def(""),validateActive:p.bool.def(!0),showHeader:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),activeBarSize:p.number.def(2),activeBarColor:p.string.def("#3a84ff")},dT={active:p.oneOfType([p.number,p.string]).def(""),type:ze("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:u1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:f1,labelHeight:p.number.def(50),scrollStep:p.number.def(200),validateActive:p.bool.def(!0),changeOnHover:p.bool.def(!1),changeOnHoverDelay:p.number.def(1e3),...lT},U3=a.defineComponent({name:"TabNav",directives:{bkTooltips:$r},props:dT,setup(e){const t=a.ref(null),n=a.computed(()=>{const h={width:0,height:0,bottom:0,left:0};if(!t.value)return h;if([Os.LEFT,Os.RIGHT].includes(e.tabPosition)){const{clientHeight:m,offsetTop:v}=t.value,y={width:`${e.activeBarSize}px`,height:`${m}px`,top:`${v}px`,background:e.activeBarColor};return e.tabPosition===Os.LEFT?y.right=0:y.left=0,y}if(e.type===Pl.UNBORDER_CARD){const{clientWidth:m,offsetLeft:v}=t.value;return{width:`${m}px`,height:`${e.activeBarSize}px`,left:`${v}px`,bottom:0,background:e.activeBarColor}}return h}),i=a.computed(()=>{if(!Array.isArray(e.panels)||!e.panels.length)return[];const h=[];let m=!1;return e.panels.filter((v,y)=>{if(!v.props)return null;const{name:C,label:b,closable:T,visible:N,disabled:k,sortable:w,tips:I}=v.props;if(!N)return!1;e.active===C&&(m=!0);const x=L=>v.slots.label?a.h(v.slots.label):[void 0,""].includes(L)?`选项卡${y+1}`:typeof L=="string"?L:typeof L=="function"?a.h(L):L;return h.push({name:C,closable:T,visible:N,disabled:k,sortable:w,tips:I,tabLabel:x(b)}),!0}),!m&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),h}),s=a.ref(-1),o=a.ref(-1),c=a.ref(""),u=(h,m)=>h===m,f={handleTabAdd(h){e.tabAdd(h)},dragstart(h,m){o.value=h,c.value=e.guid,Object.assign(m.dataTransfer,{effectAllowed:"move"}),e.tabDrag(h,m)},dragenter(h){u(c.value,e.guid)&&(s.value=h)},dragend(){s.value=-1,o.value=-1,c.value=null},drop(h,m){if(!u(c.value,e.guid))return!1;e.tabSort(o.value,h,m)},handleTabChange(h){e.tabChange(h)},handleTabRemove(h,m){e.tabRemove(h,m)}},{resolveClassName:d}=ye();return{...f,activeRef:t,activeBarStyle:n,navs:i,dragenterIndex:s,dragStartIndex:o,draggingEle:c,guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4),resolveClassName:d}},render(){const{active:e,closable:t,addable:n,sortable:i,sortType:s,labelHeight:o,dragstart:c,dragenter:u,dragend:f,drop:d}=this,h=()=>this.navs.map((b,T)=>{if(!b)return null;const{name:N,disabled:k,tabLabel:w}=b,I=()=>{const L=[this.resolveClassName("tab-header-item")];return k&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},x=(L,_)=>!k&&(L||_);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!k&&this.handleTabChange(N),draggable:x(b.sortable,i),onDragstart:L=>c(T,L),ref:e===N?"activeRef":"",onDragenter:L=>{L.preventDefault(),u(T)},onDragleave:L=>{L.preventDefault()},onDragover:L=>{L.preventDefault()},onDragend:L=>{L.preventDefault(),f()},onDrop:L=>{L.preventDefault(),d(T,s)},class:I()},[a.createVNode("div",null,[w]),x(b.closable,t)?a.createVNode("span",{class:this.resolveClassName("tab-header--close"),onClick:()=>this.handleTabRemove(T,b)},[a.createVNode(pn,null,null)]):""]),[[a.resolveDirective("bk-tooltips"),{content:b.tips,disabled:!b.tips}]])}),m=()=>{var T,N;const b=[];return typeof this.$slots.add=="function"?b.push((N=(T=this.$slots).add)==null?void 0:N.call(T,a.h)):n&&b.push(a.createVNode("div",{onClick:this.handleTabAdd},[a.createVNode(no,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((k,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[k]))]):null},v=()=>this.type===Pl.UNBORDER_CARD?a.createVNode("div",{style:this.activeBarStyle,class:this.resolveClassName("tab-header-active-bar")},null):"",y=typeof this.$slots.setting=="function"?a.createVNode("div",{class:this.resolveClassName("tab-header-setting")},[this.$slots.setting()]):null,C=m();return a.createVNode("div",{style:{lineHeight:`${o}px`},class:this.resolveClassName("tab-header")},[a.createVNode("div",{class:[this.resolveClassName("tab-header-nav"),C||y?"tab-header-auto":""]},[v(),h()]),C,y])}}),fT=a.defineComponent({name:"Tab",components:{TabNav:U3},props:uT,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup(e,{slots:t,emit:n}){const i=a.ref(!1),s=a.ref([]),o=a.getCurrentInstance(),c=(h,m=[])=>{const{children:v}=h;return(v||[]).forEach(y=>{let{type:C}=y;C=C.name||C,C==="TabPanel"&&y.component?m.push(y.component):(C===a.Fragment||C==="template")&&c(y,m)}),m},u=()=>{if(t.default){const{children:h}=o.subTree.children[1];if(!h)return;const m=h[0],v=c(m);v.length!==s.value.length&&(s.value=v)}};a.onMounted(()=>{u(),i.value=!0,a.onUpdated(()=>{u()})});const f={tabAdd(h){n("add",{e:h}),n("add-panel",{e:h})},tabChange(h){n("change",h),n("tab-change",h),n("update:active",h)},tabRemove(h,m){n("remove",h,m),n("remove-panel",h,m)},tabSort(h,m,v){const y=s.value;if(v===d1.INSERT)if(h<m)y.splice(m+1,0,s[h]),y.splice(h,1);else if(h>m)y.splice(m,0,s[h]),y.splice(h+1,1);else return!1;else{const C=y[m];y[m]=y[h],y[h]=C}s.value=[...y],n("sort",h,m,v),n("sort-change",h,m,v)},tabDrag(h,m){n("drag",h,m),n("on-drag-tab",h,m)}},{resolveClassName:d}=ye();return{...f,isMounted:i,panels:s,resolveClassName:d}},render(){var n,i;const e=()=>{const s=[this.resolveClassName("tab"),this.extCls];return this.tabPosition===Os.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Pl.CARD_TAB&&s.push(this.resolveClassName("tab--vertical-tab"))),s},t=()=>{const{panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:v,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:_}=this,S={panels:s,active:o,type:c,closable:u,addable:f,sortable:d,sortType:h,labelHeight:m,scrollStep:v,validateActive:y,changeOnHover:C,changeOnHoverDelay:b,tabPosition:T,activeBarSize:N,activeBarColor:k,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:_};return!s||!Array.isArray(s)?null:a.createVNode(U3,S,this.$slots)};return a.createVNode("div",{class:e()},[t(),a.createVNode("div",{class:this.resolveClassName("tab-content")},[(i=(n=this.$slots).default)==null?void 0:i.call(n)])])}}),hT=a.defineComponent({name:"TabPanel",props:cT,render(){const e=this.name===this.$parent.active,t=()=>!this.visible||this.renderDirective==="if"&&!e?null:typeof this.panel=="function"?this.panel(a.h):typeof this.$slots.default=="function"?this.$slots.default(null):typeof this.$slots.panel=="function"?this.$slots.panel(null):null,{resolveClassName:n}=ye();return a.withDirectives(a.createVNode("div",{ref:"content",class:n("tab-panel")},[t()]),[[a.vShow,e]])}}),h1=Xt(fT,{TabPanel:hT}),ra={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let K3=1;const g1=(e,t)=>{let n=t;const i=n.position||"top-right";typeof t=="string"&&(n={message:t});const s=t.onClose,o=n.offsetX||10;let c=n.offsetY||30;const{spacing:u=10}=n;ra[i].forEach(v=>{c+=(v.el.offsetHeight||0)+u}),K3+=1;const f=`message_${K3}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=v=>{gT(v,i,u,s),a.render(null,d)},a.render(h,d),ra[i].push(h);let m;h.props.getContainer&&Va(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function gT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;ra[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=ra[t][o].el.offsetHeight,f=ra[t].length;for(let d=o;d<f;d++){const h=parseInt(ra[t][d].el.style[s],10)-u-n;ra[t][d].component.props.offsetY=h}ra[t].splice(o,1)}var m1={exports:{}};/*!
67
67
  * clipboard.js v2.0.11
68
68
  * https://clipboardjs.com/
69
69
  *