bkui-vue 0.0.2-beta.10 → 0.0.2-beta.11

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 @@ ${$l(n)}`),i}})}function jw(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 S7(e,t){if(!km.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&&Dm&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var k7=S7,D7=L7,j7=k7,P3=10,z3=40,V3=800;function jm(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*P3,s=n*P3,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=z3,s*=z3):(i*=V3,s*=V3)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}jm.getEventType=function(){return D7.firefox()?"DOMMouseScroll":j7("wheel")?"wheel":"mousewheel"};var O7=jm,E7=O7;const A7=Bs(E7),P7=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,z7=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(P7?"DOMMouseScroll":"mousewheel",function(n){const i=A7(n);t==null||t.apply(this,[n,i])})},V7={beforeMount(e,t){console.error(e,t),z7(e,t.value)}},ca=new Map,Fr={beforeMount(e,t){const n=R3(t),{trigger:i}=n,s=J7(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(()=>{hs(e)},100)}),e.addEventListener("click",()=>{hs(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{hs(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")&&hs(e)});ca.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){ca.get(e).opts=R3(t)},unmounted(e){hs(e),ca.delete(e)}};function R7(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function R3(e){const t=R7();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function J7(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=yi.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=Om();u.appendChild(f)}return u}function Om(){const e=document.createElement("div");return e.className=Gt("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function _7(e,t){const{opts:n}=ca.get(e),{placement:i,distance:s,showOnInit:o}=n,c=gg(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&Bd(e),c}function Bd(e){const{popper:t,opts:n}=ca.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=Om();t.appendChild(f)}document.body.appendChild(t);const u=_7(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),ca.get(e).popperInstance=u}function hs(e){if(!ca.get(e))return;const{popper:t,popperInstance:n,opts:i}=ca.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const J3=(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=J3(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=J3(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}},Q7={mounted(e,t){dh(e,t)}},W7={onContentScroll:Function},H7={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),...W7},B7=(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 _3(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 Em(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=_3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,T=N.diffHeight,b=_3(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 F7(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;Em(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:v},t,e)}const Am=(e=60)=>rt.throttle((t,n,i)=>F7(t,n,i),e),$7=(e,t,n,i=60)=>{Reflect.apply(Am(i),void 0,[e,t,n])},G7={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{$7(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",Am)}}},Z7=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:G7},props:H7,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}=B7(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,A,V,E,R,J,G)=>{c.startIndex=A,c.endIndex=V,c.scrollTop=E,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&&k(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 V=0;for(let E=0;E<d.value;E++){const R=e.lineHeight.call(this,E,D.slice(E*e.groupItemCount,e.groupItemCount));V+=typeof R=="number"?R:0}h.value=V}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},v=(D={left:0,top:0})=>{var V;const A=(V=o.value)==null?void 0:V.parentNode;Em(e.lineHeight,u,c,A,null),D&&o.value&&k(D)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,A)=>({...D,$index:A}))),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:S}=ye(),w=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),x=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},Q=()=>{f(),v()},k=(D={left:0,top:0})=>{const{left:A,top:V}=D;o.value.scrollTo(A,V)};return t.expose({reset:Q,scrollTo:k}),()=>{var D,A,V,E,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((A=(D=t.slots).beforeContent)==null?void 0:A.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((E=(V=t.slots).default)==null?void 0:E.call(V,{data:C.value}))??""]),[[x,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}),$r=Ue(Z7);var Pm=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(Pm||{});const Y7=a.defineComponent({name:"Tag",props:{theme:Yl(),closable:p.bool.def(!1),type:ke("tagStorkeType",{}).def(Pm.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(()=>ze({[`${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):""])}}),_r=Ue(Y7),U7=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:Yl(),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 S=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?S[N]:S},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=b(),S=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=S>0?S: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=ze({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=ze({[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(_r,{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(_r,{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)])}}),K7=a.defineComponent({name:"Select",directives:{clickoutside:wi},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:Yl(),behavior:Dg(),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:Rw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("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:S,scrollHeight:w,list:I,displayKey:x,idKey:L,collapseTags:Q,autoHeight:k,popoverOptions:D,allowEmptyValues:A,autoFocus:V,keepSearchValue:E,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),me=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),ge=ei(),B=a.ref(),Z=a.ref(),H=a.ref(),z=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),q=a.ref(new Map),oe=a.computed(()=>[...q.value.values()]),W=a.ref(new Map),_=a.ref([]),$=a.computed(()=>_.value.reduce((Ne,je)=>(Ne[je.value]=je.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,je)=>(Ne[je[L.value]]=je[x.value],Ne),{}));a.watch(s,()=>{var Ne;oo(),e.withValidate&&((Ne=ge==null?void 0:ge.validate)==null||Ne.call(ge,"change"))},{deep:!0}),a.watch(_,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ot.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var je;return(je=hr(String(Ne[x.value])))==null?void 0:je.includes(hr(ni.value))})),de=a.computed(()=>o.value||d.value),be=a.computed(()=>_.value.map(Ne=>{var je,He;return((He=(je=q.value)==null?void 0:je.get(Ne.value))==null?void 0:He.optionName)||fe.value[Ne.value]||Ne.label})),Ie=a.computed(()=>{const Ne=oe.value.reduce((je,He)=>(He.disabled||je.push(He.optionID),je),[]);return Ne.length<=_.value.length&&Ne.every(je=>_.value.some(He=>He.value===je))}),De=a.computed(()=>!!W.value.size),Re=a.computed(()=>!oe.value.length),Ve=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),Ce=a.computed(()=>!(Zr.value||Re.value||Ve.value)||C.value),Le=a.computed(()=>u.value&&S.value&&(!ni.value||!c.value)),Je=a.computed(()=>w.value-12-(Le.value?32:0)),it=a.computed(()=>Zr.value?ie.value:Re.value?J.value:Ve.value?G.value:""),tt=a.computed(()=>k.value?Q.value&&!ti.value:Q.value),ot=a.computed(()=>rt.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:ro.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:Zl.AUTO},D.value)),{register:Mt,unregister:ht}=Pd(q),{register:vt,unregister:Ge}=Pd(W),{isHover:Ae,setHover:Ze,cancelHover:Pe}=wm(),ct=a.ref(!1),_t=()=>{ct.value||(ct.value=!0,t("focus"))},pa=()=>{ct.value&&(ct.value=!1,t("blur"))},{popperWidth:ro,isPopoverShow:ti,hidePopover:Hi,showPopover:Gr,togglePopover:Jc}=y7({popoverMinWidth:h.value},Z);a.watch(ti,()=>{t("toggle",ti.value)});const _c=a.computed(()=>(c.value&&T.value||y.value)&&ti.value);a.watch(ti,Ne=>{Ne?setTimeout(()=>{ya(),so()},10):E.value||(ni.value="")});const so=()=>{var He;const Ne=_.value[0],je=q.value.get(Ne==null?void 0:Ne.value);je&&!je.disabled&&je.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(He=oe.value.find(vn=>!vn.disabled&&vn.visible))==null?void 0:He.optionID},Qc=Ne=>{c.value&&oe.value.forEach(je=>{var He;je.visible=(He=hr(String(je.optionName)))==null?void 0:He.includes(hr(Ne))})},{searchKey:ni,searchLoading:Zr}=C7(ce.value?f.value:Qc,so),ii=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},Wc=()=>{de.value||(_t(),Jc())},Yr=Ne=>{c.value&&(ni.value=Ne)},Hc=(Ne,je)=>{const He=String(Ne);!y.value||!He||c.value&&oe.value.find(en=>hr(String(en.optionName))===hr(He))||q.value.get(He)||(je.stopPropagation(),u.value?(_.value.push({value:He,label:He}),ii(_.value.map(en=>en.value))):(_.value=[{value:He,label:He}],ii(He),Hi()),ni.value="")},va=Ne=>{if(!(de.value||!Ne)){if(u.value){const je=_.value.findIndex(He=>He.value===Ne.optionID);je>-1?_.value.splice(je,1):_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),ii(_.value.map(He=>He.value))}else _.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],ii(Ne.optionID),Hi();ya()}},ya=()=>{setTimeout(()=>{var Ne,je,He;!T.value&&!y.value?(Ne=z.value)==null||Ne.focus():v.value==="tag"?(je=Y.value)==null||je.focus():(He=B.value)==null||He.focus()},0)},Bc=Ne=>{Ne.stopPropagation(),_.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Hi()},Fc=()=>{ee.value=""},$c=()=>{Ie.value?_.value=[]:oe.value.forEach(Ne=>{Ne.disabled||_.value.find(je=>je.value===Ne.optionID)||_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),ii(_.value.map(Ne=>Ne.value)),ya()},Gc=Ne=>{const{scrollTop:je,clientHeight:He,scrollHeight:vn}=Ne.target;je+He===vn&&t("scroll-end")},Zc=Ne=>{if(de.value)return;const je=_.value.findIndex(He=>He.value===Ne);je>-1&&(_.value.splice(je,1),ii(_.value.map(He=>He.value)))},Ur=Ne=>{var He,vn;let je=Ne;if(typeof je=="object"){for(const en of q.value.keys())if(rt.isEqual(en,je)){je=en;break}}return((vn=(He=q.value)==null?void 0:He.get(je))==null?void 0:vn.optionName)||fe.value[je]||$.value[je]||je},oo=()=>{Array.isArray(s.value)?_.value=[...s.value.map(Ne=>({value:Ne,label:Ur(Ne)}))]:s.value!==void 0||A.value.includes(s.value)?_.value=[{value:s.value,label:Ur(s.value)}]:_.value=[]},lo=Ne=>{var vn,en;if(!ti.value)return;const je=oe.value.filter(tn=>!tn.disabled&&tn.visible),He=je.findIndex(tn=>tn.optionID===ee.value);if(!(!je.length||He===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const tn=He>=je.length-1?0:He+1;ee.value=(vn=je[tn])==null?void 0:vn.optionID;break}case"ArrowUp":{Ne.preventDefault();const tn=He===0?je.length-1:He-1;ee.value=(en=je[tn])==null?void 0:en.optionID;break}case"Backspace":{if(!u.value||!_.value.length||ni.value.length||Ne.target===z.value)return;_.value.pop(),ii(_.value.map(tn=>tn.value));break}case"Enter":{const tn=q.value.get(ee.value);va(tn);break}}},Yc=({event:Ne})=>{var He;const{target:je}=Ne;(He=Z.value)!=null&&He.contains(je)||Z.value===je||(Hi(),pa())},Uc=()=>{setTimeout(()=>{var Ne,je;N.value&&((je=(Ne=X.value)==null?void 0:Ne.reset)==null||je.call(Ne))})};return a.provide(Sc,a.reactive({multiple:u,selected:_,activeOptionValue:ee,showSelectedIcon:b,selectedStyle:R,register:Mt,unregister:ht,registerGroup:vt,unregisterGroup:Ge,handleOptionSelected:va,handleGetLabelByValue:Ur})),a.onMounted(()=>{oo(),setTimeout(()=>{m.value&&Gr(),V.value&&ya()})}),{selected:_,isInput:_c,options:oe,isDisabled:de,selectedLabel:be,isPopoverShow:ti,isHover:Ae,popperWidth:ro,inputRef:B,triggerRef:Z,contentRef:H,searchRef:z,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Zr,isOptionsEmpty:Re,isSearchEmpty:Ve,isFocus:ct,isShowSelectContent:Ce,curContentText:it,isGroup:De,searchKey:ni,isShowSelectAll:Le,virtualHeight:Je,virtualList:K,isCollapseTags:tt,popoverConfig:ot,focusInput:ya,setHover:Ze,cancelHover:Pe,handleFocus:_t,handleBlur:pa,handleTogglePopover:Wc,handleClear:Bc,hidePopover:Hi,showPopover:Gr,handleToggleAll:$c,handleOptionSelected:va,handleClickOutside:Yc,handleScroll:Gc,handleDeleteTag:Zc,handleInputChange:Yr,handleInputEnter:Hc,handleKeydown:lo,handleSelectedAllOptionMouseEnter:Fc,handlePopoverShow:Uc,localLoadingText:ie,localPlaceholder:me,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=ze({[`${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(la,{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(Ua,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(U7,{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(Fa,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(Ka,{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(la,{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($r,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(kl,{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(kl,{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(la,{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(K7,{Option:kl,Group:b7});function X7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:q7}=$a,hh=Object.assign({},q7);hh.width.default="400";hh.height.default="100%";const eL=a.defineComponent({name:"Sideslider",components:{BkModal:$a,BkButton:At},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($a,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),X7(u)?u:{default:()=>[u]})}}}),zm=Ue(eL);var Vm=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Vm||{});const Q3={theme:p.theme().def(Gl.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:xg(),status:ke("status",{}).def(Vm.UNKNOWN),lineType:Sg(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},tL=a.defineComponent({name:"Steps",props:Q3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("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=>{Q3.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=ze({[`${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(Us,{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(ha,{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])]):""])})])}}),Rm=Ue(tL),nL=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(vc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),Jm=Ue(nL);var Dl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(Dl||{}),_m=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(_m||{});const iL=["auto","highlight"],aL=["none","row","col","outer","horizontal"],Fe={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"},Mr=6,Pa=42;var Qm=(e=>(e.DEF1="def1",e.DEF2="def2",e))(Qm||{});const pl={large:78,medium:60,small:42},rL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:pl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:pl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:pl.large}],Wm="InitColumns",Hm="BKTableCahce",sL="Bk_COlumn_Update_Define",oL=60;var Vt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Vt||{});const lL=["asc","desc","null","custom"],za=80;var Bm=(e=>(e.CURRENT="current",e.ALL="all",e))(Bm||{});ke("showOverflowTooltipMode",{default:"auto"});const cL=ke("columnType",{default:"none"}),Fd=ke("columnType",{default:""});ke("full",{default:"full"});ke("columnSize",{default:"small"});const uL=fn(),gh=ke("IOverflowTooltipPropType",{}).def(!1);ke("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const dL=ke("ISortPropShape",{}).def(!1),fL=ke("IFilterPropShape",{}).def(!1);var Fm=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(Fm||{});const kc=ke("IColumnType",{}),$m=ke("ITableSettingPropType",{}).def(!1);ke("IColumnPropType",{}).def({label:void 0,minWidth:za});const hL={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(kc).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ke("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),stripe:p.bool.def(!1),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:ke("ITheadType",{}).def({color:Qm.DEF1,height:Pa,isShow:!0}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ke("boderType",{})),p.string]).def([Dl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(oL),remotePagination:p.bool.def(!1),emptyText:p.string,settings:$m,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(Fe.ROW_INDEX),showOverflowTooltip:gh,asyncData:p.bool.def(!1),rowHover:p.oneOf(iL).def(_m.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ke("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:Fd,headerAlign:Fd,prependStyle:p.style().def({})},gL={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:gh,type:cL,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,uL]).def(!1),sort:dL,filter:fL,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]),prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},mL=a.defineComponent({name:"TableColumn",props:gL,setup(e){const t=a.inject(Wm,(s,o=!1)=>{},!1),n=a.inject(Hm,{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(sL,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 pL{constructor(){Se(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])}}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||{}),Ot=(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))(Ot||{});const vL=e=>!0,yL=e=>!0,CL=e=>!0,bL=e=>!0,rl=(e,t,n,i,s)=>!0,wL=e=>!0,NL=e=>!0,ML=e=>!0,IL=e=>!0,W3=e=>!0,LL=e=>!0,H3=e=>!0,TL=e=>!0,xL={columnPick:vL,columnFilter:yL,columnSort:bL,colFilterSave:CL,rowClick:rl,rowDblclick:rl,rowExpand:wL,select:NL,selectAll:ML,selectionChange:IL,pageLimitChange:W3,pageValueChange:W3,settingChange:LL,scrollBottom:TL,cellClick:H3,cellDblclick:H3,rowMouseEnter:rl,rowMouseLeave:rl},B3=(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{}},SL=(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=B3(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===Bm.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=B3(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}},kL=(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(la,{loading:f,size:d,mode:h,title:m,inline:v,indicator:y},null)}}}};function DL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const jL=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},DL(f=t.limitList.map((d,h)=>a.createVNode(kl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Sa=5,OL=()=>{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<=Sa+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(Sa/2);e.totalPageNum>Sa&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Sa,Math.max(2,t.value-b));for(let N=T;N<T+Sa;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-Sa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Sa)},{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(bi,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(Vs,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(Vs,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)])])}},EL=()=>{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 S=1;S<=e.totalPageNum;S++)N.push(S);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 S=N.target,w=Number(S.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(bi,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)])])}},AL=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])},PL={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"])},zL=a.defineComponent({name:"Pagination",props:PL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=AL(n),{current:u,render:f}=OL(),{current:d,render:h}=EL(),{limit:m,render:v}=jL(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=ze({[`${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(zL);var Gm=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,jl=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")()}(),VL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(jl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),RL=2;function JL(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){VL(o)}function u(){var f=Date.now();if(n){if(f-s<RL)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var _L=20,QL=["top","right","bottom","left","width","height","size","weight"],WL=typeof MutationObserver<"u",HL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=JL(this.refresh.bind(this),_L)}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),WL?(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=QL.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}(),Zm=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},Qr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||jl},Ym=Dc(0,0,0,0);function Ol(e){return parseFloat(e)||0}function F3(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+Ol(o)},0)}function BL(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]=Ol(c)}return n}function FL(e){var t=e.getBBox();return Dc(0,0,t.width,t.height)}function $L(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ym;var i=Qr(e).getComputedStyle(e),s=BL(i),o=s.left+s.right,c=s.top+s.bottom,u=Ol(i.width),f=Ol(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=F3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=F3(i,"top","bottom")+c)),!ZL(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 GL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Qr(e).SVGGraphicsElement}:function(e){return e instanceof Qr(e).SVGElement&&typeof e.getBBox=="function"}}();function ZL(e){return e===Qr(e).document.documentElement}function YL(e){return $d?GL(e)?FL(e):$L(e):Ym}function UL(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 Zm(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 KL=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=YL(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}(),XL=function(){function e(t,n){var i=UL(n);Zm(this,{target:t,contentRect:i})}return e}(),qL=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new Gm,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 Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new KL(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 Qr(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 XL(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}(),Um=typeof WeakMap<"u"?new WeakMap:new Gm,Km=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=HL.getInstance(),i=new qL(t,n,this);Um.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Km.prototype[e]=function(){var t;return(t=Um.get(this))[e].apply(t,arguments)}});var eT=function(){return typeof jl.ResizeObserver<"u"?jl.ResizeObserver:Km}();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)]:[],tT=e=>Xm(e,"auto"),Xm=(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},nT=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>aL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},ks=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],gd=(e,t,n=za,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<za?za: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(ks(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],za);Object.assign(t[m],{calcWidth:v})})}},qm=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?rt.debounce(o,n):rt.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new eT(()=>{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[Fe.ROW_INDEX]+1:rt.get(e,t),ws=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?ws(Reflect.apply(e,globalThis,t),t):[],e1=(e,t,n)=>{const i=t1(e,t,n);return i!==null?i:Vi.v4()},t1=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Fe.ROW_INDEX?`__ROW_INDEX_${n}`:rt.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,iT=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},n1=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),$3=(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,i1=(e,t,n,i)=>{const s=$3(e,t,n,i,"colspan"),o=$3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},a1=(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===Vt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Vt.DESC?-1:1)},r1=e=>{const t={[Vt.NULL]:0,[Vt.ASC]:1,[Vt.DESC]:2};return e===void 0?Vt.NULL:Object.keys(t)[(t[e]+1)%3]},s1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Vt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},vl=(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,aT=(e,t,n)=>{if(e[Fe.ROW_UID]!==void 0)return e[Fe.ROW_UID];const i=e1(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},Ds=e=>a.unref(e[Fe.ROW_SOURCE_DATA]||e),o1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),G3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:gh,title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ke("ResizerWay",{default:Fm.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||!Ra(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=Gb(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=qm(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 rT{constructor(t,n){Se(this,"props",null);Se(this,"ctx",null);this.props=t,this.ctx=n}}const sT=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ft("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(Lc,{scene:"part",type:i.value,description:n.value},null)}}),oT=a.defineComponent({name:"HeadFilter",props:{column:kc,height:p.number.def(Pa)},emits:["change","filterSave"],setup(e,{emit:t}){var V;const{resolveClassName:n}=ye(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((V=o.value)==null?void 0:V.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>ze({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=ze({[n("table-head-filter")]:!0}),h=a.ref(null),m=E=>{u.isOpen=E,E&&setTimeout(()=>{h.value.reset()})},v=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:E=[]}=o.value;return E}),C=(E,R="ig")=>new RegExp(`${E}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),b=(E,R)=>{const{match:J}=o.value,G=El(R,Rt(s,"field",[s,R]),s);return J==="full"&&E.includes(G),E.some(ie=>C(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(E,R,J,G)=>o.value.filterFn(E,R,e.column,J,G):(E,R)=>E.length?b(E,R):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(E=!1)=>{const{disabled:R}=I(x,i.value.confirm);if(R||E){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=(E,R)=>({disabled:E==="disabled"||E===!1,text:typeof E=="string"?E:R}),{btnSave:x,btnReset:L}=o.value,Q=()=>{const{disabled:E,text:R}=I(x,i.value.confirm);return E?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},k=()=>{const{disabled:E,text:R}=I(L,i.value.reset);return E?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(E,R)=>{const J=new Set(u.checked);E?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),S()},A=E=>E.data.length?E.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:Zl.SHOWN,arrow:!1,offset:0},{theme:v},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(hc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Ic,{class:"content-list"},{default:()=>[a.createVNode($r,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:A})]}),a.createVNode("div",{class:"content-footer"},[Q(),a.createVNode("span",{class:"btn-filter-split"},null),k()])])})}}),lT=a.defineComponent({name:"HeadSort",props:{column:kc,defaultSort:p.oneOf(lL).def(Vt.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||Vt.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===Vt.NULL&&(h=r1(d)),s.value===d&&(h=Vt.NULL);const m=a1(e.column,h),v=s1(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,Vt.NULL)},[a.createVNode(ql,{class:["sort-action","sort-asc",e.active&&s.value===Vt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Vt.ASC)},null),a.createVNode(Ys,{class:["sort-action","sort-desc",e.active&&s.value===Vt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Vt.DESC)},null)])}});function Z3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const cT=a.defineComponent({name:"Settings",props:{settings:$m,columns:p.arrayOf(kc).def([]),rowHeight:p.number.def(Pa)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=ft("table"),s=rL(i),o=(J,G)=>Rt(J,["id","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},S=()=>{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((me,ue)=>me.disabled&&m.value.includes(o(me,ue))).map((me,ue)=>o(me,ue));if(c.value){const me=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...me,...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),Q=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),k=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),A={marginRight:"12px"},V=()=>x.map(J=>a.createVNode("span",{class:D(J),onClick:()=>k(J)},[J.label])),E=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:S},[a.createVNode(ac,{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(Ks,{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:!!E.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Ic,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},Z3(J=C.value.map((G,ie)=>{let me;return a.createVNode("div",{class:"field-item"},[a.createVNode(Xn,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:Q(G,ie)},Z3(me=Rt(G,["name","label"],[G,ie]))?me:{default:()=>[me]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),V()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:A,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:A,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+ks(C),0),right:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>v&&b===0?y:y+ks(C),n?Mr:0)},c=(v,y,C=0)=>{const b=y[Kn.COL_UID],T=v==="right"?-1:1,N=t.filter(x=>!x.isHidden),{length:S}=N;let w=v==="right"?S*T:1,I=0;for(w;;){w=w+-1*T;const x=Math.abs(w),L=N[x],Q=s(L),k=L[Kn.COL_UID];if(Q===v&&b!==k){const D=ks(L);I=I+D}if(b===k)break}return I+C},u=(v,y=!1)=>{if(!v.fixed||v.isHidden)return{};const C={left:0,right:y?Mr:0},b=s(v);return C[b]=c(b,v,C[b]),{[b]:`${C[b]}px`}},f=v=>({width:`${o[v](!1)}px`,backgroundColor:e.thead.color,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 Y3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class uT{constructor(t,n,i,s,o,c){Se(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])});Se(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]);Se(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 rT(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=n1(u,d,s)}),this.emitEvent(Rn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(cT,{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(sT,{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(Ot.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Ot.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(Ot.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=r1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=a1(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(lT,{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(Ot.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(oT,{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`,backgroundColor:this.props.thead.color},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(Fe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Fe.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(G3,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},Y3(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:`${Mr+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=[...ws(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...ws(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:t1(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 S;const h=[n(f),...ws(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:v,rowspan:y}=i1(f,d,s,o),C=Fe.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((S=s[C])==null?void 0:S[b])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...ws(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Fe.ROW_EXPAND],"is-last":o+y>=i}],x=(L,Q)=>{const k={event:L,row:Ds(s),column:o1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(Q,k)};return a.createVNode("td",{class:I,style:h,colspan:v,rowspan:y,onClick:L=>x(L,Ot.CELL_CLICK),onDblclick:L=>x(L,Ot.CELL_DBL_CLICK)},[a.createVNode(G3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},Y3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Fe.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${aT(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,Ds(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Ot.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Ot.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Fe.ROW_EXPAND]?a.createVNode(Xs,null,null):a.createVNode(no,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[Fe.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(Fe.ROW_SELECTION_INDETERMINATE),c=vl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(Xn,{onChange:s,disabled:!c,modelValue:t[Fe.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=ze({active:this.isColActive(n)}),s=`${tT(ks(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:[]}}),U3=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):[],dT=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=jc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(U3(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=U3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},fT=(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,Q=Number(f.minWidth);f.resizeWidth=L>Q?L:Q,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=>rt.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 S=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:S}},hT=(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(()=>ze({[Gt("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},nT(e.border))),m=ze({[Gt("table-head")]:!0,"has-settings":!!e.settings}),v=a.computed(()=>o()),y=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":`${i.scrollTranslateY}px`})),C=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":"0px",right:d.value?`${Mr-2}px`:"0px"})),b=Gd(e),T=a.computed(()=>({"--row-height":`${Rt(b,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[Gt("table-body")]:!0},S=a.computed(()=>ze({[Gt("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),w=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(v.value.every(R=>/^\d+\.?\d*(px)?$/ig.test(`${R.width}`))){const R=v.value.reduce((G,ie)=>G+Number(`${ie.width}`.replace(/px/ig,"")),0),J=u.value?Mr:0;return`${R+J}px`}return"100%"},x=a.computed(()=>({minHeight:Xm(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:w()})),L=(R,J)=>{const G=String(R);if(/^\d+\.?\d*$/.test(G))return Number(G);if(/^\d+\.?\d*px$/ig.test(G))return Number(G.replace("px",""));if(/^\d+\.?\d*%$/ig.test(G)&&typeof J=="number"){const ie=Number(G.replace("%",""));return J*ie/100}return J},Q=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),k=()=>e.showHead?L(e.headHeight,Pa):0,D=()=>{const R=L(e.height,c.value),J=k(),G=L(e.minHeight,c.value),ie=e.pagination&&e.data.length?e.paginationHeight:0,me=R-J-ie,ue=e.height!=="auto"?`${me}px`:!1,ae=G-J-ie,ge=L(e.maxHeight,void 0),B=typeof ge=="number"?`${ge-J-ie}px`:!1;Object.assign(Q,{display:s!=null&&s.length?"block":!1,"min-height":`${ae}px`,height:ue,maxHeight:B})};a.onMounted(()=>{A(n==null?void 0:n.value)});const A=R=>{if(R){const{height:J}=R.parentElement.getBoundingClientRect();c.value=J,D(),V(R)}},V=R=>{if(!R)return;const J=e.virtualEnabled?`.${Gt("virtual-section")}`:`.${Gt("table-body-content")}`,G=R.querySelector(`.${Gt("table-body")}`);u.value=iT(G,J,0)};return{tableClass:h,headClass:m,contentClass:N,footerClass:S,wrapperStyle:x,contentStyle:Q,headStyle:T,offsetXVarStyle:y,headOffsetXVarStyle:C,resetTableHeight:A,updateBorderClass:V,getColumnsWidthOffsetWidth:()=>{let R=0;return u.value&&(R=R+Mr),e.border.includes(Dl.OUTER)&&!e.border.includes(Dl.NONE)&&(R=R+2),R},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},gT=(e,t)=>{var q,oe;const n=a.reactive([]),{getColumns:i}=jc(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let _=za;return W.sort&&(_=_+18),W.filter&&(_=_+28),_},o=a.computed(()=>i()),c=W=>{var ee,fe;const _=(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:n1($,K,_),[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}=fT(n,!0),{activeColumns:m}=dT(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const v=rt.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{v()},{immediate:!0,deep:!0});const y=e.columns.reduce((W,_,$)=>{const ee=Rt(_,["field","type"],[_,$]),fe=s1(_.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:(q=e.settings)==null?void 0:q.size,height:pl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:y||e.defaultSort}),b=W=>{var _;return C.rowActions.has(W)?(_=C.rowActions.get(W))==null?void 0:_.isExpand:!1},T=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(W,_=void 0)=>{const $=W[Fe.ROW_UID],ee=typeof _=="boolean"?_:!b($);C.rowActions.set($,Object.assign({},C.rowActions.get($)??{},{isExpand:ee})),ae()},S=()=>C.rowActions.has(Fe.ROW_SELECTION_ALL)?C.rowActions.get(Fe.ROW_SELECTION_ALL):e.selectionKey?E.every(W=>A(W)):!1,w=W=>{const _=W[Fe.ROW_UID],{isSelected:$=!1}=C.rowActions.get(_)||{};return $},I=(W=w)=>{let _=!1,$=!1;E.forEach(ee=>{const fe=W(ee);!_&&!fe&&(_=!0),!$&&fe&&($=!0)}),C.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,$&&_),C.rowActions.set(Fe.ROW_SELECTION_ALL,$&&!_)},x=()=>e.columns.some(W=>W.type==="selection"),L=()=>{x()&&I(W=>A(W))},Q=(W=void 0)=>{const _=typeof W=="boolean"?W:!S();C.rowActions.set(Fe.ROW_SELECTION_ALL,_),C.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,!1),E.forEach(($,ee)=>{if(vl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[Fe.ROW_UID],K=Object.assign({},C.rowActions.get(fe)??{},{isSelected:_});C.rowActions.set(fe,K)}}),I(),ae(_),Z(null,W,!0)},k=()=>{Q(!1)},D=(W,_)=>{const $=W[Fe.ROW_UID];if($){const ee=typeof _=="boolean"?_:!V(W,$),fe=Object.assign({},C.rowActions.get($)??{},{isSelected:ee});C.rowActions.set($,fe),_||C.rowActions.set(Fe.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,_,!1)}},A=(W,_=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?rt.get(W,e.selectionKey):_(W),V=(W,_,$)=>A(W,()=>{var fe;const ee=_===void 0?W[Fe.ROW_UID]:_;return vl(e,{row:W,index:$,isCheckAll:!1})&&S()?!0:C.rowActions.has(ee)?(fe=C.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),E=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")),me=(W=!1)=>{let _=null;const $={},ee=e.data.map(fe=>({[Fe.ROW_UID]:Vi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const be=e1(K,e,de);_=be;const Ie={...K,[Fe.ROW_UID]:K[Fe.ROW_UID]||be,[Fe.ROW_SOURCE_DATA]:{...K}};if(R.value){const De=ge(K,be,de,$,_);Object.assign(Ie,{[Fe.ROW_SKIP_CFG]:De})}return J.value&&Object.assign(Ie,{[Fe.ROW_SELECTION]:V(K,be,de)}),ie.value&&Object.assign(Ie,{[Fe.ROW_INDEX]:de}),G.value&&Object.assign(Ie,{[Fe.ROW_EXPAND]:W?b(be):!1}),Ie});E.length=0,E.push(...fe),J.value&&L();return}E.length=0,E.push(...ee)},ue=(W,_,$,ee)=>{const fe=V($,$[Fe.ROW_UID],ee);return W&&typeof _=="boolean"?_:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let _=null;const $={};E.forEach((ee,fe)=>{const K=ee[Fe.ROW_UID];if(G.value&&Object.assign(ee,{[Fe.ROW_EXPAND]:b(ee[Fe.ROW_UID])}),R.value){const de=ge(ee,K,fe,$,_);_=ee[Fe.ROW_UID],Object.assign(ee,{[Fe.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[Fe.ROW_INDEX]:fe}),J.value){const de=vl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[Fe.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},ge=(W,_,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[_]||(ee[_]={}),n.forEach((be,Ie)=>{var Le;const{colspan:De,rowspan:Re}=i1(be,Ie,W,$),Ve=be[Kn.COL_UID],ce=((Le=de[Ve])==null?void 0:Le.skipRowLen)??0,Ce={[Ve]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(Ce[Ve].skipColLen=K,Ce[Ve].skipCol=!0,K=K-1),ce>1?(Ce[Ve].skipRowLen=ce-1,Ce[Ve].skipRow=!0):Re>1&&(Ce[Ve].skipRowLen=Re,Ce[Ve].skipRow=!1),De>1&&(Ce[Ve].skipColLen=De,K=De-1),Object.assign(ee[_],{...Ce})}),ee[_]},B=rt.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,_,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{rt.has(ee,e.selectionKey)&&rt.set(ee,e.selectionKey,!!_)});else if(rt.has(W,e.selectionKey)){const ee=e.data.find(fe=>rt.get(fe,e.rowKey)===rt.get(W,e.rowKey));rt.set(ee,e.selectionKey,!!_)}}},{fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,fixedWrapperClass:X}=Zd(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:E,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,initIndexData:me,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:k,toggleAllSelection:Q,toggleRowSelection:D,getSelection:()=>E.filter(W=>V(W)),clearSort:T}},mT=a.defineComponent({name:"Table",props:hL,emits:xL,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new pL,u=a.reactive([]),{initColumns:f}=jc(e,u);a.provide(Wm,f),a.provide(Hm,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:S,resolveColumnClass:w,setRowExpand:I,initIndexData:x,fixedWrapperClass:L,clearSelection:Q,toggleAllSelection:k,toggleRowSelection:D,getSelection:A,clearSort:V,updateColGroups:E}=gT(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=SL(e,T),{tableClass:me,headClass:ue,contentClass:ae,footerClass:ge,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:z,offsetXVarStyle:Y,headOffsetXVarStyle:X,updateBorderClass:re,resetTableHeight:q,getColumnsWidthOffsetWidth:oe,hasFooter:W}=hT(e,u,d,b,R),{resolveClassName:_}=ye(),$=a.computed(()=>({hasScrollY:z.value})),ee=new uT(e,t,b,v,$,n),fe=()=>{const Ge=d.value.querySelector(`.${_("table-body-content")}`),Ae=Ge.querySelector("table");if(Ae){const Ze=Ae.scrollWidth,Pe=Ge.clientWidth;m.value=Ze-Pe}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{x(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{q(d.value),re(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Ge=oe();gd(d.value,v,20,Ge),fe()}}),ee.on(Rn.ON_SORT_BY_CLICK,Ge=>{const{sortFn:Ae,column:Ze,index:Pe,type:ct}=Ge;typeof Ae=="function"&&(i=Ae,s=Ze,Object.assign(s,{[Kn.SORT_TYPE]:ct}),G(o,i,s)),t.emit(Ot.COLUMN_SORT,{column:a.unref(Ze[Kn.COL_SOURCE_DATA]),index:Pe,type:ct})}).on(Rn.ON_FILTER_CLICK,Ge=>{const{filterFn:Ae,checked:Ze,column:Pe,index:ct}=Ge;typeof Ae=="function"&&(o=Ae,G(o,i,s)),t.emit(Ot.COLUMN_FILTER,{checked:Ze,column:a.unref(Pe[Kn.COL_SOURCE_DATA]),index:ct})}).on(Rn.ON_SETTING_CHANGE,Ge=>{const{checked:Ae=[],size:Ze,height:Pe,fields:ct}=Ge;a.nextTick(()=>{E({checked:Ae,fields:ct}),re(d.value);const _t=oe();Ae.length&&gd(d.value,v,za,_t),t.emit(Ot.SETTING_CHANGE,{checked:Ae,size:Ze,height:Pe,fields:ct})})}).on(Rn.ON_ROW_EXPAND_CLICK,Ge=>{const{row:Ae,column:Ze,index:Pe,rows:ct,e:_t}=Ge;t.emit(Ot.ROW_EXPAND_CLICK,{row:Ds(Ae),column:o1(Ze),index:Pe,rows:ct,e:_t}),I(Ae,!Ae[Fe.ROW_EXPAND])}).on(Rn.ON_ROW_CHECK,({row:Ge,isAll:Ae,index:Ze,value:Pe})=>{Ae?(k(Pe),t.emit(Ot.ROW_SELECT_ALL,{checked:Pe,data:e.data})):(D(Ge,Pe),t.emit(Ot.ROW_SELECT,{row:Ds(Ge),index:Ze,checked:Pe,data:e.data})),t.emit(Ot.ROW_SELECT_CHANGE,{row:Ds(Ge),isAll:Ae,index:Ze,checked:Pe,data:e.data})});const K=Ge=>{const Ae=b.pos.bottom??0,Ze=Ge[1],{translateX:Pe,translateY:ct,pos:_t={}}=Ze;b.scrollTranslateY=ct,b.scrollTranslateX=Pe,b.pos=_t;const{bottom:pa}=_t;pa<=2&&Ae>pa&&Gs(60,()=>{t.emit(Ot.SCROLL_BOTTOM,{..._t,translateX:Pe,translateY:ct})},!0)(),fe()},de=(Ge={left:0,top:0})=>{var Ae,Ze;(Ze=(Ae=h.value)==null?void 0:Ae.scrollTo)==null||Ze.call(Ae,Ge)};a.onMounted(()=>{if(e.observerResize){let Ge=qm(d.value,()=>{if(!d.value)return;e.height==="100%"||e.height,re(d.value);const Ae=oe();gd(d.value,v,20,Ae)},180,!0,e.resizerWay);Ge.start(),a.onBeforeUnmount(()=>{Ge.disconnect(),Ge=null})}}),a.onBeforeUnmount(()=>{ee.destroy()});const be=()=>d.value;t.expose({setRowExpand:I,clearSelection:Q,toggleAllSelection:k,toggleRowSelection:D,getSelection:A,clearSort:V,scrollTo:de,getRoot:be});const Ie=a.computed(()=>({...ae,"__is-empty":!R.length})),De=a.computed(()=>({[_("table-body-content")]:!0,[_("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Re={column_drag_line:!0,"offset-x":!0},Ve=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},Ce=a.computed(()=>({[_("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Le={zIndex:-1,width:0,height:0,display:"none"},Je=a.computed(()=>({"--footer-height":W.value?`${e.paginationHeight}px`:"0"})),{renderScrollLoading:it}=kL(e,t),tt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),ot=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),Mt=()=>N.value.map(({isExist:Ge,colPos:Ae,column:Ze})=>Ge?"":a.createVNode("div",{class:w(Ze,b.scrollTranslateX,m.value),style:S(Ae)},null)),ht=()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:Ce.value},null),a.createVNode("div",{class:L,style:Y.value},[Mt(),a.createVNode("div",{class:Re,style:Ve.value},null),a.createVNode("div",{class:ce},[it()])])]),vt=()=>t.slots.prepend?a.createVNode("div",{style:ot.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Ge,Ae;return a.createVNode("div",{class:me.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[[ee.renderTableHeadSchema(),a.createVNode("div",{class:L,style:X.value},[Mt()])]]),a.createVNode($r,a.mergeProps({ref:h,lineHeight:ee.getRowHeight,class:Ie.value,style:Z,list:R},tt.value,{contentClassName:De.value,onContentScroll:K,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>vt(),default:Ze=>ee.renderTableBodySchema(Ze.data||R),afterSection:()=>ht()}),a.createVNode("div",{class:ge.value,style:Je.value},[W.value&&ee.renderTableFooter(J.value)]),a.createVNode("div",{style:Le},[(Ae=(Ge=t.slots).default)==null?void 0:Ae.call(Ge)])])}}}),l1=Xt(mT,{Column:mL}),gr=12;function pT(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 vT(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 K3=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},c1=(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}},X3=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])])}}),yT=()=>({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:ke("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:()=>({})}}),CT=a.defineComponent({name:"TagRender",directives:{bkTooltips:Fr},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=Kb(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]])}}),bT=a.defineComponent({name:"TagInput",directives:{bkTooltips:Fr},props:yT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ft("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}=pT(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),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>k.selectedTagList.length===0&&m.value===""&&!s.isEdit),x=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&k.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),Q=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),k=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>k.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:A,saveKeyMap:V}=vT(e),E=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([()=>A.value],()=>{a.nextTick(()=>{me()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var Ce;ge(D.value,ce)||(a.nextTick(()=>{me()}),e.withValidate&&((Ce=n==null?void 0:n.validate)==null||Ce.call(n,"change")))}),a.watch(m,rt.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(()=>{me()});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 Je=f.curPage+1;Je<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Je)},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&&(k.tagListCache=[...D.value],k.selectedTagListCache=[...k.selectedTagList],m.value=k.selectedTagListCache[0][e.saveKey],De(k.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var Ce;(Ce=v.value)==null||Ce.focus(),e.trigger==="focus"&&k.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},me=()=>{const{saveKey:ce,modelValue:Ce,displayKey:Le,allowCreate:Je,trigger:it,isAsyncList:tt}=e;if(k.selectedTagList=[],k.localList=A.value,Ce.length){const ot={};k.selectedTagList=Ce.map(Mt=>{const ht=V.value[Mt];return ot[Mt]=1,!ht&&Je?{[ce]:Mt,[Le]:Mt}:ht}).filter(Mt=>Mt),w.value||(k.localList=k.localList.filter(Mt=>!ot[Mt[ce]]))}if(tt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}it==="focus"&&ue()},ue=(ce="")=>{const{searchKey:Ce,filterCallback:Le}=e,Je=ce.toLowerCase().trim();if(Je===""){d(k.localList);return}let it=[];typeof Le=="function"?it=Le(Je,Ce,k.localList)||[]:Array.isArray(Ce)?it=k.localList.filter(tt=>Ce.some(ot=>tt[ot].toLowerCase().indexOf(Je)>-1)):it=k.localList.filter(tt=>tt[Ce].toLowerCase().indexOf(Je)>-1),d(it)},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 ge(ce,Ce){return ce.length!==Ce.length?!1:Ce.every((Le,Je)=>ce[Je]===Le)}const B=()=>{k.tagListCache=[],k.selectedTagListCache=[],k.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const Ce=G().findIndex(({id:Le})=>Le==="tagInputItem");return Ce>=0?Ce:0},z=(ce,Ce,Le=!1)=>{if(!Ce||!ce)return;let Je=Ce;Le&&(Je=Ce.nextElementSibling||null),Ce.parentNode.insertBefore(ce,Je)},Y=ce=>{const{maxData:Ce,trigger:Le,allowCreate:Je}=e;if(Ce===-1||Ce>D.value.length){const{value:it}=ce!=null&&ce.target?ce.target:m,tt=K3(it);tt?(ue(it),v.value.style.width=`${tt*gr}px`):Le==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Je?-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]=k.tagListCache;ce&&ce===Le&&k.selectedTagListCache.length?Ie(k.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Le=f.curPageList.find(Je=>Array.isArray(e.searchKey)?e.searchKey.map(tt=>Je[tt]).includes(ce):Je[e.searchKey]===ce);Le?q(Le,"select"):e.allowCreate&&q(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(Ce=n==null?void 0:n.validate)==null||Ce.call(n,"blur")},200)},q=(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(),De(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)},_=ce=>{ce.stopPropagation();const Ce=k.selectedTagList;k.selectedTagList=[];const Le=Ce.filter(Je=>V.value[Je[e.saveKey]]);(e.allowCreate&&Le.length!==0||!e.allowCreate)&&!w.value&&k.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 Je=Le.yAxis+Le.height-ce.yAxis;Je>ce.height&&(T.value.scrollTop=T.value.scrollTop+Je-ce.height)})},ee=(ce,Ce)=>{const Le=G();z(b.value,Le[ce-1]),k.selectedTagList.splice(ce-1,1),ie();const Je=V.value[Ce[e.saveKey]];(e.allowCreate&&Je||!e.allowCreate)&&!w.value&&k.localList.push(Ce),v.value=`${gr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let Ce;const Le=ce.target.value,Je=K3(Le),it=H(),tt=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,!Je){if(it<1)return;z(b.value,tt[it-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Je){if(it===tt.length-1)return;z(tt[it+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?q(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&q(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":it!==0&&!m.value&&(Ce=k.selectedTagList[it-1],ee(it,Ce));break}},K=ce=>{const Ce=[],Le=ce.split(";"),Je=/^[a-zA-Z][a-zA-Z_]*/g;return Le.forEach(it=>{const tt=it.match(Je);if(tt){const ot=tt.join("");Ce.push({[e.saveKey]:ot,[e.displayKey]:ot})}}),Ce},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:Ce,saveKey:Le,displayKey:Je,pasteFn:it,allowCreate:tt}=e,ot=ce.clipboardData.getData("text");let ht=(it?it(ot):K(ot)).map(vt=>vt[Le]);if(ht.length){const vt=G(),Ge=H(),Ae=k.localList.map(Pe=>Pe[Le]);if(ht=ht.filter(Pe=>{const ct=(Pe==null?void 0:Pe.trim())&&!D.value.includes(Pe);return tt?ct:ct&&Ae.includes(Pe)}),Ce!==-1){const Pe=k.selectedTagList.length;if(Pe<Ce){const ct=Ce-Pe;ht.length>ct&&(ht=[...ht.slice(0,ct)])}else ht=[]}const Ze=tt?ht.map(Pe=>k.localList.find(_t=>_t[Le]===Pe)??{[Le]:Pe,[Je]:Pe}):k.localList.filter(Pe=>ht.includes(Pe[Le]));ht.length&&(k.selectedTagList.splice(Ge,0,...Ze),z(b.value,vt[Ge]),v.value.style.width=`${gr}px`,k.localList=k.localList.filter(Pe=>!ht.includes(Pe[Le])),W("select"),ie())}},be=ce=>{e.disabled||(z(b.value,ce.currentTarget,!0),v.value.style.width=`${gr}px`,o.isShow&&R())},Ie=(ce,Ce)=>{if(k.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Le,saveKey:Je,displayKey:it,createTagValidator:tt}=e,ot=H();let Mt=1,ht=!1,vt;const Ge=Ae=>typeof tt=="function"?tt(Ae):!0;if(Ce==="custom")if(Le){let Ae=ce.split(Le);Ae=Ae.filter(Pe=>(Pe==null?void 0:Pe.trim())&&!D.value.includes(Pe)&&Ge(Pe));const Ze=Ae.map(Pe=>V.value[Pe]||{[Je]:Pe,[it]:Pe});Ae.length&&(k.selectedTagList.splice(ot,0,...Ze),Mt=Ze.length,ht=!0)}else{const Ae=typeof ce=="object";if(vt=Ae?ce[Je]:ce.trim(),vt=vt.replace(/\s+/g,""),vt!==void 0&&!D.value.includes(vt)&&Ge(vt)){const Ze=V.value[vt]||(Ae?ce:{[Je]:vt,[it]:vt});k.selectedTagList.splice(ot,0,Ze),ht=!0}}else ce&&(vt=ce[Je],vt!==void 0&&!D.value.includes(vt)&&(k.selectedTagList.splice(ot,0,ce),ht=!0));ht&&a.nextTick(()=>{for(let Ae=1;Ae<=Mt;Ae++){const Pe=G()[ot+Ae];z(Pe,b.value)}if(v.value.style.width=`${gr}px`,!w.value){e.allowNextFocus&&ie();const Ae=D.value.reduce((Ze,Pe)=>(Ze[Pe]=1,Ze),{});k.localList=k.localList.filter(Ze=>!Ae[Ze[Je]])}})},De=(ce,Ce)=>{k.selectedTagList.splice(Ce,1);const Le=V.value[ce[e.saveKey]];(e.allowCreate&&Le||!e.allowCreate)&&!w.value&&k.localList.push(ce)},Re=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Ve}=c1(y,Re,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(k),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:x,curInputValue:m,renderList:E,showTagClose:S,tagInputRef:v,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:T,triggerClass:Q,overflowTagIndex:Ve,localCollapseTags:Re,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:q,handleTagRemove:oe,handleClear:_,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(CT,{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(X3,{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(X3,{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(la,{theme:"primary",size:Qa.Small},null)]):null])])})])}}),u1=Ue(bT),wT={direction:xg(),align:Dd().def(Il.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:Sg()},NT=a.defineComponent({name:"Divider",props:wT,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])}}),d1=Ue(NT);var Al=(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))(Al||{}),js=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(js||{});const f1=ke("position",{}).def("top");var h1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(h1||{});const g1=ke("sortType",{}).def("replace"),MT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},IT={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},LT={active:p.oneOfType([p.number,p.string]).def(""),type:ke("type",{}).def("border-card"),tabPosition:f1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g1,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")},TT={active:p.oneOfType([p.number,p.string]).def(""),type:ke("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:f1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g1,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),...MT},q3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Fr},props:TT,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([js.LEFT,js.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===js.LEFT?y.right=0:y.left=0,y}if(e.type===Al.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:S,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:S,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:S,tabLabel:w}=b,I=()=>{const L=[this.resolveClassName("tab-header-item")];return S&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},x=(L,Q)=>!S&&(L||Q);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&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(to,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((S,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[S]))]):null},v=()=>this.type===Al.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])}}),xT=a.defineComponent({name:"Tab",components:{TabNav:q3},props:LT,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===h1.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===js.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Al.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:S,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:Q}=this,k={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:S,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:Q};return!s||!Array.isArray(s)?null:a.createVNode(q3,k,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)])])}}),ST=a.defineComponent({name:"TabPanel",props:IT,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]])}}),m1=Xt(xT,{TabPanel:ST}),aa={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let e6=1;const p1=(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;aa[i].forEach(v=>{c+=(v.el.offsetHeight||0)+u}),e6+=1;const f=`message_${e6}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=v=>{kT(v,i,u,s),a.render(null,d)},a.render(h,d),aa[i].push(h);let m;h.props.getContainer&&Ra(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function kT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;aa[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=aa[t][o].el.offsetHeight,f=aa[t].length;for(let d=o;d<f;d++){const h=parseInt(aa[t][d].el.style[s],10)-u-n;aa[t][d].component.props.offsetY=h}aa[t].splice(o,1)}var v1={exports:{}};/*!
66
+ */function S7(e,t){if(!km.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&&Dm&&e==="wheel"&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var k7=S7,D7=L7,j7=k7,P3=10,z3=40,V3=800;function jm(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*P3,s=n*P3,"deltaY"in e&&(s=e.deltaY),"deltaX"in e&&(i=e.deltaX),(i||s)&&e.deltaMode&&(e.deltaMode==1?(i*=z3,s*=z3):(i*=V3,s*=V3)),i&&!t&&(t=i<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:t,spinY:n,pixelX:i,pixelY:s}}jm.getEventType=function(){return D7.firefox()?"DOMMouseScroll":j7("wheel")?"wheel":"mousewheel"};var O7=jm,E7=O7;const A7=Bs(E7),P7=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,z7=function(e,t){e!=null&&e.addEventListener&&e.addEventListener(P7?"DOMMouseScroll":"mousewheel",function(n){const i=A7(n);t==null||t.apply(this,[n,i])})},V7={beforeMount(e,t){console.error(e,t),z7(e,t.value)}},ca=new Map,Fr={beforeMount(e,t){const n=R3(t),{trigger:i}=n,s=J7(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(()=>{hs(e)},100)}),e.addEventListener("click",()=>{hs(e)}),s.addEventListener("mouseleave",()=>{clearTimeout(o),c=setTimeout(()=>{hs(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")&&hs(e)});ca.set(e,{opts:n,popper:s,popperInstance:null})},updated(e,t){ca.get(e).opts=R3(t)},unmounted(e){hs(e),ca.delete(e)}};function R7(){return{arrow:!0,disabled:!1,trigger:"hover",theme:"dark",content:"",showOnInit:!1,placement:"top",distance:8,extCls:"",delay:0,onShow:()=>{},onHide:()=>{}}}function R3(e){const t=R7();return typeof e.value=="object"?Object.assign(t,e.value):t.content=e.value,t}function J7(e){const{content:t,arrow:n,theme:i,extCls:s}=e,o=i==="light",c=yi.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=Om();u.appendChild(f)}return u}function Om(){const e=document.createElement("div");return e.className=Gt("popper-arrow"),e.setAttribute("data-popper-arrow",""),e}function _7(e,t){const{opts:n}=ca.get(e),{placement:i,distance:s,showOnInit:o}=n,c=gg(e,t,{placement:i,modifiers:[{name:"offset",options:{offset:[0,s]}}]});return o&&Bd(e),c}function Bd(e){const{popper:t,opts:n}=ca.get(e),{disabled:i,content:s,arrow:o,onShow:c}=n;if(i)return;if(t.innerText=s,o){const f=Om();t.appendChild(f)}document.body.appendChild(t);const u=_7(e,t);c(),t.setAttribute("data-show",""),u.setOptions(f=>({...f,modifiers:[...f.modifiers,{name:"eventListeners",enabled:!0}]})),u.forceUpdate(),ca.get(e).popperInstance=u}function hs(e){if(!ca.get(e))return;const{popper:t,popperInstance:n,opts:i}=ca.get(e),{onHide:s}=i;t&&document.body.contains(t)&&(t.removeAttribute("data-show"),n==null||n.destroy(),document.body.removeChild(t),s())}const J3=(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=J3(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=J3(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}},Q7={mounted(e,t){dh(e,t)}},W7={onContentScroll:Function},H7={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),...W7},B7=(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 _3(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 Em(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=_3(f,o,d,e);C=N.startIndex>0?N.startIndex:0,T=N.diffHeight,b=_3(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 F7(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;Em(i,s,{scrollTop:m,startIndex:u,endIndex:f,groupItemCount:d,count:h,scrollLeft:v},t,e)}const Am=(e=60)=>rt.throttle((t,n,i)=>F7(t,n,i),e),$7=(e,t,n,i=60)=>{Reflect.apply(Am(i),void 0,[e,t,n])},G7={mounted(e,t){const n=e.parentNode,{throttleDelay:i}=t.value;n.addEventListener("scroll",s=>{$7(s,n,t,i)})},unbind(e){if(e){const t=e.parentNode;if(!t)return;t.removeEventListener("scroll",Am)}}},Z7=a.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:G7},props:H7,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}=B7(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,A,V,E,R,J,G)=>{c.startIndex=A,c.endIndex=V,c.scrollTop=E,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&&k(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 V=0;for(let E=0;E<d.value;E++){const R=e.lineHeight.call(this,E,D.slice(E*e.groupItemCount,e.groupItemCount));V+=typeof R=="number"?R:0}h.value=V}else h.value=e.lineHeight*d.value;else h.value=e.abosuteHeight},v=(D={left:0,top:0})=>{var V;const A=(V=o.value)==null?void 0:V.parentNode;Em(e.lineHeight,u,c,A,null),D&&o.value&&k(D)},y=a.computed(()=>e.rowKey!==void 0?e.list:(e.list||[]).map((D,A)=>({...D,$index:A}))),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:S}=ye(),w=a.computed(()=>[S("virtual-render"),e.scrollXName,e.scrollYName,...s(e.className),e.scrollPosition==="container"?S("virtual-content"):""]),I=a.computed(()=>[e.scrollPosition==="content"?S("virtual-content"):"",...s(e.contentClassName)]),x=a.resolveDirective("bkVirtualRender"),L={lineHeight:e.lineHeight,handleScrollCallback:u,pagination:c,throttleDelay:e.throttleDelay},Q=()=>{f(),v()},k=(D={left:0,top:0})=>{const{left:A,top:V}=D;o.value.scrollTo(A,V)};return t.expose({reset:Q,scrollTo:k}),()=>{var D,A,V,E,R,J,G,ie;return a.h(n||"div",{ref:o,class:w.value,style:T.value},[((A=(D=t.slots).beforeContent)==null?void 0:A.call(D))??"",a.withDirectives(a.h(i||"div",{class:I.value,style:{...b.value,...e.contentStyle}},[((E=(V=t.slots).default)==null?void 0:E.call(V,{data:C.value}))??""]),[[x,L]]),((J=(R=t.slots).afterContent)==null?void 0:J.call(R))??"",a.h("div",{class:[S("virtual-section")],style:N.value}),((ie=(G=t.slots).afterSection)==null?void 0:ie.call(G))??""])}}}),$r=Ue(Z7);var Pm=function(e){return e.UNKNOWN="",e.FILLED="filled",e.STROKE="stroke",e}(Pm||{});const Y7=a.defineComponent({name:"Tag",props:{theme:Yl(),closable:p.bool.def(!1),type:ke("tagStorkeType",{}).def(Pm.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(()=>ze({[`${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):""])}}),_r=Ue(Y7),U7=a.defineComponent({name:"SelectTagInput",props:{selected:{type:Array,default:()=>[]},tagTheme:Yl(),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 S=[...i.$el.querySelectorAll(`.${n("tag")}`)];return typeof N=="number"?S[N]:S},T=()=>{c.value&&(h.value=null,setTimeout(()=>{const N=b(),S=N.findIndex((w,I)=>I?N[I-1].offsetTop!==w.offsetTop:!1);h.value=S>0?S: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=ze({[this.resolveClassName("select-tag")]:!0,[this.resolveClassName("select-tag--default")]:!0,"is-disabled":this.disabled,"collapse-tag":this.collapseTags,"has-prefix":!!e}),n=ze({[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(_r,{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(_r,{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)])}}),K7=a.defineComponent({name:"Select",directives:{clickoutside:wi},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:Yl(),behavior:Dg(),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:Rw()},emits:["update:modelValue","change","toggle","clear","scroll-end","focus","blur"],setup(e,{emit:t}){const n=ft("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:S,scrollHeight:w,list:I,displayKey:x,idKey:L,collapseTags:Q,autoHeight:k,popoverOptions:D,allowEmptyValues:A,autoFocus:V,keepSearchValue:E,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),me=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),ge=ei(),B=a.ref(),Z=a.ref(),H=a.ref(),z=a.ref(),Y=a.ref(),X=a.ref(),re=a.ref(),q=a.ref(new Map),oe=a.computed(()=>[...q.value.values()]),W=a.ref(new Map),_=a.ref([]),$=a.computed(()=>_.value.reduce((Ne,je)=>(Ne[je.value]=je.label,Ne),{})),ee=a.ref(),fe=a.computed(()=>I.value.reduce((Ne,je)=>(Ne[je[L.value]]=je[x.value],Ne),{}));a.watch(s,()=>{var Ne;oo(),e.withValidate&&((Ne=ge==null?void 0:ge.validate)==null||Ne.call(ge,"change"))},{deep:!0}),a.watch(_,()=>{var Ne;(Ne=re.value)==null||Ne.updatePopover(null,ot.value)});const K=a.computed(()=>ce.value?I.value:I.value.filter(Ne=>{var je;return(je=hr(String(Ne[x.value])))==null?void 0:je.includes(hr(ni.value))})),de=a.computed(()=>o.value||d.value),be=a.computed(()=>_.value.map(Ne=>{var je,He;return((He=(je=q.value)==null?void 0:je.get(Ne.value))==null?void 0:He.optionName)||fe.value[Ne.value]||Ne.label})),Ie=a.computed(()=>{const Ne=oe.value.reduce((je,He)=>(He.disabled||je.push(He.optionID),je),[]);return Ne.length<=_.value.length&&Ne.every(je=>_.value.some(He=>He.value===je))}),De=a.computed(()=>!!W.value.size),Re=a.computed(()=>!oe.value.length),Ve=a.computed(()=>oe.value.length&&oe.value.every(Ne=>!Ne.visible)),ce=a.computed(()=>c.value&&typeof f.value=="function"),Ce=a.computed(()=>!(Zr.value||Re.value||Ve.value)||C.value),Le=a.computed(()=>u.value&&S.value&&(!ni.value||!c.value)),Je=a.computed(()=>w.value-12-(Le.value?32:0)),it=a.computed(()=>Zr.value?ie.value:Re.value?J.value:Ve.value?G.value:""),tt=a.computed(()=>k.value?Q.value&&!ti.value:Q.value),ot=a.computed(()=>rt.merge({theme:`light ${i("select-popover")}`,trigger:"manual",width:ro.value,arrow:!1,placement:"bottom-start",isShow:ti.value,reference:Y.value,offset:6,popoverDelay:0,renderType:Zl.AUTO},D.value)),{register:Mt,unregister:ht}=Pd(q),{register:vt,unregister:Ge}=Pd(W),{isHover:Ae,setHover:Ze,cancelHover:Pe}=wm(),ct=a.ref(!1),_t=()=>{ct.value||(ct.value=!0,t("focus"))},pa=()=>{ct.value&&(ct.value=!1,t("blur"))},{popperWidth:ro,isPopoverShow:ti,hidePopover:Hi,showPopover:Gr,togglePopover:Jc}=y7({popoverMinWidth:h.value},Z);a.watch(ti,()=>{t("toggle",ti.value)});const _c=a.computed(()=>(c.value&&T.value||y.value)&&ti.value);a.watch(ti,Ne=>{Ne?setTimeout(()=>{ya(),so()},10):E.value||(ni.value="")});const so=()=>{var He;const Ne=_.value[0],je=q.value.get(Ne==null?void 0:Ne.value);je&&!je.disabled&&je.visible?ee.value=Ne==null?void 0:Ne.value:ee.value=(He=oe.value.find(vn=>!vn.disabled&&vn.visible))==null?void 0:He.optionID},Qc=Ne=>{c.value&&oe.value.forEach(je=>{var He;je.visible=(He=hr(String(je.optionName)))==null?void 0:He.includes(hr(Ne))})},{searchKey:ni,searchLoading:Zr}=C7(ce.value?f.value:Qc,so),ii=Ne=>{Ne!==s.value&&(t("update:modelValue",Ne,s.value),t("change",Ne,s.value))},Wc=()=>{de.value||(_t(),Jc())},Yr=Ne=>{c.value&&(ni.value=Ne)},Hc=(Ne,je)=>{const He=String(Ne);!y.value||!He||c.value&&oe.value.find(en=>hr(String(en.optionName))===hr(He))||q.value.get(He)||(je.stopPropagation(),u.value?(_.value.push({value:He,label:He}),ii(_.value.map(en=>en.value))):(_.value=[{value:He,label:He}],ii(He),Hi()),ni.value="")},va=Ne=>{if(!(de.value||!Ne)){if(u.value){const je=_.value.findIndex(He=>He.value===Ne.optionID);je>-1?_.value.splice(je,1):_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID}),ii(_.value.map(He=>He.value))}else _.value=[{label:Ne.optionName||Ne.optionID,value:Ne.optionID}],ii(Ne.optionID),Hi();ya()}},ya=()=>{setTimeout(()=>{var Ne,je,He;!T.value&&!y.value?(Ne=z.value)==null||Ne.focus():v.value==="tag"?(je=Y.value)==null||je.focus():(He=B.value)==null||He.focus()},0)},Bc=Ne=>{Ne.stopPropagation(),_.value=[],ii(u.value?[]:""),t("clear",u.value?[]:""),Hi()},Fc=()=>{ee.value=""},$c=()=>{Ie.value?_.value=[]:oe.value.forEach(Ne=>{Ne.disabled||_.value.find(je=>je.value===Ne.optionID)||_.value.push({value:Ne.optionID,label:Ne.optionName||Ne.optionID})}),ii(_.value.map(Ne=>Ne.value)),ya()},Gc=Ne=>{const{scrollTop:je,clientHeight:He,scrollHeight:vn}=Ne.target;je+He===vn&&t("scroll-end")},Zc=Ne=>{if(de.value)return;const je=_.value.findIndex(He=>He.value===Ne);je>-1&&(_.value.splice(je,1),ii(_.value.map(He=>He.value)))},Ur=Ne=>{var He,vn;let je=Ne;if(typeof je=="object"){for(const en of q.value.keys())if(rt.isEqual(en,je)){je=en;break}}return((vn=(He=q.value)==null?void 0:He.get(je))==null?void 0:vn.optionName)||fe.value[je]||$.value[je]||je},oo=()=>{Array.isArray(s.value)?_.value=[...s.value.map(Ne=>({value:Ne,label:Ur(Ne)}))]:s.value!==void 0||A.value.includes(s.value)?_.value=[{value:s.value,label:Ur(s.value)}]:_.value=[]},lo=Ne=>{var vn,en;if(!ti.value)return;const je=oe.value.filter(tn=>!tn.disabled&&tn.visible),He=je.findIndex(tn=>tn.optionID===ee.value);if(!(!je.length||He===-1))switch(Ne.code){case"ArrowDown":{Ne.preventDefault();const tn=He>=je.length-1?0:He+1;ee.value=(vn=je[tn])==null?void 0:vn.optionID;break}case"ArrowUp":{Ne.preventDefault();const tn=He===0?je.length-1:He-1;ee.value=(en=je[tn])==null?void 0:en.optionID;break}case"Backspace":{if(!u.value||!_.value.length||ni.value.length||Ne.target===z.value)return;_.value.pop(),ii(_.value.map(tn=>tn.value));break}case"Enter":{const tn=q.value.get(ee.value);va(tn);break}}},Yc=({event:Ne})=>{var He;const{target:je}=Ne;(He=Z.value)!=null&&He.contains(je)||Z.value===je||(Hi(),pa())},Uc=()=>{setTimeout(()=>{var Ne,je;N.value&&((je=(Ne=X.value)==null?void 0:Ne.reset)==null||je.call(Ne))})};return a.provide(Sc,a.reactive({multiple:u,selected:_,activeOptionValue:ee,showSelectedIcon:b,selectedStyle:R,register:Mt,unregister:ht,registerGroup:vt,unregisterGroup:Ge,handleOptionSelected:va,handleGetLabelByValue:Ur})),a.onMounted(()=>{oo(),setTimeout(()=>{m.value&&Gr(),V.value&&ya()})}),{selected:_,isInput:_c,options:oe,isDisabled:de,selectedLabel:be,isPopoverShow:ti,isHover:Ae,popperWidth:ro,inputRef:B,triggerRef:Z,contentRef:H,searchRef:z,selectTagInputRef:Y,virtualRenderRef:X,popoverRef:re,searchLoading:Zr,isOptionsEmpty:Re,isSearchEmpty:Ve,isFocus:ct,isShowSelectContent:Ce,curContentText:it,isGroup:De,searchKey:ni,isShowSelectAll:Le,virtualHeight:Je,virtualList:K,isCollapseTags:tt,popoverConfig:ot,focusInput:ya,setHover:Ze,cancelHover:Pe,handleFocus:_t,handleBlur:pa,handleTogglePopover:Wc,handleClear:Bc,hidePopover:Hi,showPopover:Gr,handleToggleAll:$c,handleOptionSelected:va,handleClickOutside:Yc,handleScroll:Gc,handleDeleteTag:Zc,handleInputChange:Yr,handleInputEnter:Hc,handleKeydown:lo,handleSelectedAllOptionMouseEnter:Fc,handlePopoverShow:Uc,localLoadingText:ie,localPlaceholder:me,localSearchPlaceholder:ue,localSelectAllText:ae,resolveClassName:i}},render(){const e=ze({[`${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(la,{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(Ua,{class:"angle-up"},null),n=()=>{var o,c;return this.multipleMode==="tag"?a.createVNode(U7,{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(Fa,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(Ka,{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(la,{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($r,{list:this.virtualList,height:this.virtualHeight,lineHeight:32,ref:"virtualRenderRef"},{default:({data:u})=>u.map(f=>{var d,h;return a.createVNode(kl,{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(kl,{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(la,{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(K7,{Option:kl,Group:b7});function X7(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const{propsMixin:q7}=$a,hh=Object.assign({},q7);hh.width.default="400";hh.height.default="100%";const eL=a.defineComponent({name:"Sideslider",components:{BkModal:$a,BkButton:At},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($a,a.mergeProps(e,{maxHeight:d,class:f,style:`${e.direction}: 0;`,onHidden:o,onShown:s,onClose:i}),X7(u)?u:{default:()=>[u]})}}}),zm=Ue(eL);var Vm=function(e){return e.UNKNOWN="",e.ERROR="error",e.LOADING="loading",e}(Vm||{});const Q3={theme:p.theme().def(Gl.PRIMARY),size:p.size(),curStep:p.number.def(1),controllable:p.bool.def(!1),direction:xg(),status:ke("status",{}).def(Vm.UNKNOWN),lineType:Sg(),text:p.bool,extCls:p.string,steps:p.array.def([]),beforeChange:p.func},tL=a.defineComponent({name:"Steps",props:Q3,emits:["update:curStep","click"],setup(e,{emit:t}){const n=ft("steps"),i=ft("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=>{Q3.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=ze({[`${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(Us,{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(ha,{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("step"),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])]):""])})])}}),Rm=Ue(tL),nL=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(vc,{class:`${i("switcher-loading")}`},null):"",e.showText?a.createVNode("span",{class:"switcher-text"},[o.value?e.onText:e.offText]):""])}}),Jm=Ue(nL);var Dl=(e=>(e.NONE="none",e.ROW="row",e.COL="col",e.OUTER="outer",e.HORIZONTAL="horizontal",e))(Dl||{}),_m=(e=>(e.HIGHLIGHT="highlight",e.AUTO="auto",e))(_m||{});const iL=["auto","highlight"],aL=["none","row","col","outer","horizontal"],Fe={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"},Mr=6,Pa=42;var Qm=(e=>(e.DEF1="def1",e.DEF2="def2",e))(Qm||{});const pl={large:78,medium:60,small:42},rL=e=>[{value:"small",label:e.value.setting.lineHeight.small,height:pl.small},{value:"medium",label:e.value.setting.lineHeight.medium,height:pl.medium},{value:"large",label:e.value.setting.lineHeight.large,height:pl.large}],Wm="InitColumns",Hm="BKTableCahce",sL="Bk_COlumn_Update_Define",oL=60;var Vt=(e=>(e.ASC="asc",e.DESC="desc",e.NULL="null",e.CUSTOM="custom",e))(Vt||{});const lL=["asc","desc","null","custom"],za=80;var Bm=(e=>(e.CURRENT="current",e.ALL="all",e))(Bm||{});ke("showOverflowTooltipMode",{default:"auto"});const cL=ke("columnType",{default:"none"}),Fd=ke("columnType",{default:""});ke("full",{default:"full"});ke("columnSize",{default:"small"});const uL=fn(),gh=ke("IOverflowTooltipPropType",{}).def(!1);ke("IOverflowTooltipType",{}).def({content:"",disabled:!1,watchCellResize:!0,mode:"auto"});const dL=ke("ISortPropShape",{}).def(!1),fL=ke("IFilterPropShape",{}).def(!1);var Fm=(e=>(e.DEBOUNCE="debounce",e.THROTTLE="throttle",e))(Fm||{});const kc=ke("IColumnType",{}),$m=ke("ITableSettingPropType",{}).def(!1);ke("IColumnPropType",{}).def({label:void 0,minWidth:za});const hL={data:p.arrayOf(p.any).def([]),columns:p.arrayOf(kc).def([]),activeColumn:p.oneOfType([p.number.def(-1),p.arrayOf(p.number.def(-1))]),columnPick:ke("columnPick",{}).def("disabled"),height:p.oneOfType([p.number,p.string]).def("auto"),stripe:p.bool.def(!1),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:ke("ITheadType",{}).def({color:Qm.DEF1,height:Pa,isShow:!0}),virtualEnabled:p.bool.def(!1),border:p.oneOfType([p.arrayOf(ke("boderType",{})),p.string]).def([Dl.ROW]),pagination:p.oneOfType([p.bool.def(!1),p.object.def({})]).def(!1),paginationHeight:p.number.def(oL),remotePagination:p.bool.def(!1),emptyText:p.string,settings:$m,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(Fe.ROW_INDEX),showOverflowTooltip:gh,asyncData:p.bool.def(!1),rowHover:p.oneOf(iL).def(_m.HIGHLIGHT),defaultSort:p.shape({}).def({}),isRowSelectEnable:p.oneOfType([p.func.def(()=>!0),p.bool.def(!0)]).def(!0),resizerWay:ke("ResizerWay",{default:"debounce"}),observerResize:p.bool.def(!0),align:Fd,headerAlign:Fd,prependStyle:p.style().def({})},gL={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:gh,type:cL,resizable:p.bool.def(!0),fixed:p.oneOfType([p.bool,uL]).def(!1),sort:dL,filter:fL,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]),prop:p.oneOfType([p.func.def(()=>""),p.string.def("")]),index:p.number.def(void 0)},mL=a.defineComponent({name:"TableColumn",props:gL,setup(e){const t=a.inject(Wm,(s,o=!1)=>{},!1),n=a.inject(Hm,{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(sL,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 pL{constructor(){Se(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])}}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||{}),Ot=(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))(Ot||{});const vL=e=>!0,yL=e=>!0,CL=e=>!0,bL=e=>!0,rl=(e,t,n,i,s)=>!0,wL=e=>!0,NL=e=>!0,ML=e=>!0,IL=e=>!0,W3=e=>!0,LL=e=>!0,H3=e=>!0,TL=e=>!0,xL={columnPick:vL,columnFilter:yL,columnSort:bL,colFilterSave:CL,rowClick:rl,rowDblclick:rl,rowExpand:wL,select:NL,selectAll:ML,selectionChange:IL,pageLimitChange:W3,pageValueChange:W3,settingChange:LL,scrollBottom:TL,cellClick:H3,cellDblclick:H3,rowMouseEnter:rl,rowMouseLeave:rl},B3=(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{}},SL=(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=B3(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===Bm.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=B3(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}},kL=(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(la,{loading:f,size:d,mode:h,title:m,inline:v,indicator:y},null)}}}};function DL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const jL=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},DL(f=t.limitList.map((d,h)=>a.createVNode(kl,{id:d,name:`${d}`,key:`${h}_${d}`},null)))?f:{default:()=>[f]}),a.createVNode("div",null,[e.value.strip])]):null}}},Sa=5,OL=()=>{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<=Sa+2){for(let N=2;N<=e.totalPageNum-1;N++)C.push(N);return C}const b=Math.floor(Sa/2);e.totalPageNum>Sa&&(s.value=t.value-b>2,o.value=t.value+b<e.totalPageNum-1);const T=Math.min(e.totalPageNum-Sa,Math.max(2,t.value-b));for(let N=T;N<T+Sa;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-Sa)},m=()=>{t.value=Math.min(e.totalPageNum,t.value+Sa)},{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(bi,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(Vs,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(Vs,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)])])}},EL=()=>{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 S=1;S<=e.totalPageNum;S++)N.push(S);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 S=N.target,w=Number(S.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(bi,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)])])}},AL=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])},PL={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"])},zL=a.defineComponent({name:"Pagination",props:PL,emits:["update:modelValue","change","update:limit","limitChange"],setup(e,t){const n=ft("pagination"),i=a.ref(0),{count:s,limit:o}=a.toRefs(e),c=AL(n),{current:u,render:f}=OL(),{current:d,render:h}=EL(),{limit:m,render:v}=jL(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=ze({[`${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(zL);var Gm=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,jl=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")()}(),VL=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(jl):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),RL=2;function JL(e,t){var n=!1,i=!1,s=0;function o(){n&&(n=!1,e()),i&&u()}function c(){VL(o)}function u(){var f=Date.now();if(n){if(f-s<RL)return;i=!0}else n=!0,i=!1,setTimeout(c,t);s=f}return u}var _L=20,QL=["top","right","bottom","left","width","height","size","weight"],WL=typeof MutationObserver<"u",HL=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=JL(this.refresh.bind(this),_L)}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),WL?(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=QL.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}(),Zm=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},Qr=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||jl},Ym=Dc(0,0,0,0);function Ol(e){return parseFloat(e)||0}function F3(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+Ol(o)},0)}function BL(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]=Ol(c)}return n}function FL(e){var t=e.getBBox();return Dc(0,0,t.width,t.height)}function $L(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Ym;var i=Qr(e).getComputedStyle(e),s=BL(i),o=s.left+s.right,c=s.top+s.bottom,u=Ol(i.width),f=Ol(i.height);if(i.boxSizing==="border-box"&&(Math.round(u+o)!==t&&(u-=F3(i,"left","right")+o),Math.round(f+c)!==n&&(f-=F3(i,"top","bottom")+c)),!ZL(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 GL=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Qr(e).SVGGraphicsElement}:function(e){return e instanceof Qr(e).SVGElement&&typeof e.getBBox=="function"}}();function ZL(e){return e===Qr(e).document.documentElement}function YL(e){return $d?GL(e)?FL(e):$L(e):Ym}function UL(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 Zm(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 KL=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=YL(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}(),XL=function(){function e(t,n){var i=UL(n);Zm(this,{target:t,contentRect:i})}return e}(),qL=function(){function e(t,n,i){if(this.activeObservations_=[],this.observations_=new Gm,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 Qr(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new KL(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 Qr(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 XL(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}(),Um=typeof WeakMap<"u"?new WeakMap:new Gm,Km=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=HL.getInstance(),i=new qL(t,n,this);Um.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Km.prototype[e]=function(){var t;return(t=Um.get(this))[e].apply(t,arguments)}});var eT=function(){return typeof jl.ResizeObserver<"u"?jl.ResizeObserver:Km}();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)]:[],tT=e=>Xm(e,"auto"),Xm=(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},nT=e=>{const t=["row"];return typeof e=="string"&&t.push(e),Array.isArray(e)&&t.push(...e.filter(n=>aL.includes(n))),[...new Set(t)].map(n=>`bordered-${n}`).join(" ")},ks=(e,t=["resizeWidth","calcWidth","width"])=>e[t[0]]??e[t[1]]??e[t[2]],gd=(e,t,n=za,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<za?za: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(ks(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],za);Object.assign(t[m],{calcWidth:v})})}},qm=(e,t,n=60,i=!1,s="throttle")=>{const o=()=>{typeof t=="function"&&t()},c=s==="debounce"?rt.debounce(o,n):rt.throttle(o,n),u=()=>Reflect.apply(c,globalThis,[]),f=new eT(()=>{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[Fe.ROW_INDEX]+1:rt.get(e,t),ws=(e,t)=>Array.isArray(e)?e:typeof e=="string"||typeof e=="object"?[e]:typeof e=="function"?ws(Reflect.apply(e,globalThis,t),t):[],e1=(e,t,n)=>{const i=t1(e,t,n);return i!==null?i:Vi.v4()},t1=(e,t,n)=>typeof t.rowKey=="string"?t.rowKey===Fe.ROW_INDEX?`__ROW_INDEX_${n}`:rt.get(e,t.rowKey):typeof t.rowKey=="function"?Reflect.apply(t.rowKey,globalThis,[e]):null,iT=(e,t,n=0)=>{if(e){const i=e.querySelector(t);if(i)return i.offsetHeight>e.offsetHeight-n}return!1},n1=(e,t,n)=>(s=>e.some(o=>o.field===Rt(s,["field","type"],[s])))(t)&&n.length&&!n.includes(Rt(t,["field","type"],[t])),$3=(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,i1=(e,t,n,i)=>{const s=$3(e,t,n,i,"colspan"),o=$3(e,t,n,i,"rowspan");return{colspan:s,rowspan:o}},a1=(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===Vt.NULL?()=>!0:(f,d)=>o(f,d)*(t===Vt.DESC?-1:1)},r1=e=>{const t={[Vt.NULL]:0,[Vt.ASC]:1,[Vt.DESC]:2};return e===void 0?Vt.NULL:Object.keys(t)[(t[e]+1)%3]},s1=e=>{if(typeof e=="string")return{value:e};if(typeof e=="boolean"&&e)return{value:Vt.NULL};if(typeof e=="object"&&e!==null){return e.sortFn,{value:"custom",...e};return e}return null},vl=(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,aT=(e,t,n)=>{if(e[Fe.ROW_UID]!==void 0)return e[Fe.ROW_UID];const i=e1(e,n,t);return i!==void 0&&e[i]!==void 0?e[i]:t},Ds=e=>a.unref(e[Fe.ROW_SOURCE_DATA]||e),o1=e=>a.unref(e[Kn.COL_SOURCE_DATA]||e),G3=a.defineComponent({name:"TableCell",props:{column:p.any.def({}),row:p.any.def({}),parentSetting:gh,title:p.string.def(void 0),observerResize:p.bool.def(!0),resizerWay:ke("ResizerWay",{default:Fm.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||!Ra(n.value))return;const{mode:h,disabled:m}=f();if(i.value=!m,h==="auto"&&(i.value=Gb(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=qm(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 rT{constructor(t,n){Se(this,"props",null);Se(this,"ctx",null);this.props=t,this.ctx=n}}const sT=a.defineComponent({name:"BodyEmpty",props:{list:p.array.def([]),filterList:p.array.def([]),emptyText:p.string},emits:["change"],setup(e){const t=ft("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(Lc,{scene:"part",type:i.value,description:n.value},null)}}),oT=a.defineComponent({name:"HeadFilter",props:{column:kc,height:p.number.def(Pa)},emits:["change","filterSave"],setup(e,{emit:t}){var V;const{resolveClassName:n}=ye(),i=ft("table"),{column:s}=e,{filter:o}=a.toRefs(e.column),c=a.ref(((V=o.value)==null?void 0:V.checked)??[]),u=a.reactive({isOpen:!1,checked:c.value}),f=a.computed(()=>ze({[n("table-head-action")]:!0,"column-filter":!0,"--row-height":`${e.height}px`,active:u.checked.length,opened:u.isOpen})),d=ze({[n("table-head-filter")]:!0}),h=a.ref(null),m=E=>{u.isOpen=E,E&&setTimeout(()=>{h.value.reset()})},v=`light ${n("table-head-filter")}`,y=a.computed(()=>{const{list:E=[]}=o.value;return E}),C=(E,R="ig")=>new RegExp(`${E}`.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),R),b=(E,R)=>{const{match:J}=o.value,G=El(R,Rt(s,"field",[s,R]),s);return J==="full"&&E.includes(G),E.some(ie=>C(ie,"img").test(G))},T=typeof o.value.filterFn=="function"?(E,R,J,G)=>o.value.filterFn(E,R,e.column,J,G):(E,R)=>E.length?b(E,R):!0,N=()=>{S(!0),t("filterSave",[...u.checked]),u.isOpen=!1},S=(E=!1)=>{const{disabled:R}=I(x,i.value.confirm);if(R||E){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=(E,R)=>({disabled:E==="disabled"||E===!1,text:typeof E=="string"?E:R}),{btnSave:x,btnReset:L}=o.value,Q=()=>{const{disabled:E,text:R}=I(x,i.value.confirm);return E?a.createVNode("span",{class:"btn-filter-save disabled"},[R]):a.createVNode("span",{class:"btn-filter-save",onClick:N},[R])},k=()=>{const{disabled:E,text:R}=I(L,i.value.reset);return E?"":a.createVNode("span",{class:["btn-filter-reset",u.checked.length?"":"disable"],onClick:w},[R])},D=(E,R)=>{const J=new Set(u.checked);E?J.add(R.value):J.delete(R.value),u.checked.length=0,u.checked.push(...Array.from(J)),S()},A=E=>E.data.length?E.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:Zl.SHOWN,arrow:!1,offset:0},{theme:v},{onAfterShow:()=>m(!0),onAfterHidden:()=>m(!1)}),{default:()=>a.createVNode(hc,{class:f.value},null),content:()=>a.createVNode("div",{class:d},[a.createVNode(Ic,{class:"content-list"},{default:()=>[a.createVNode($r,{lineHeight:32,list:y.value,throttleDelay:0,scrollEvent:!0,ref:h,className:"content-items"},{default:A})]}),a.createVNode("div",{class:"content-footer"},[Q(),a.createVNode("span",{class:"btn-filter-split"},null),k()])])})}}),lT=a.defineComponent({name:"HeadSort",props:{column:kc,defaultSort:p.oneOf(lL).def(Vt.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||Vt.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===Vt.NULL&&(h=r1(d)),s.value===d&&(h=Vt.NULL);const m=a1(e.column,h),v=s1(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,Vt.NULL)},[a.createVNode(ql,{class:["sort-action","sort-asc",e.active&&s.value===Vt.ASC?"active":""],style:"align-items: flex-end;",onClick:f=>o(f,Vt.ASC)},null),a.createVNode(Ys,{class:["sort-action","sort-desc",e.active&&s.value===Vt.DESC?"active":""],style:"align-items: flex-start;",onClick:f=>o(f,Vt.DESC)},null)])}});function Z3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const cT=a.defineComponent({name:"Settings",props:{settings:$m,columns:p.arrayOf(kc).def([]),rowHeight:p.number.def(Pa)},emits:["change"],setup(e,{emit:t}){const{resolveClassName:n}=ye(),i=ft("table"),s=rL(i),o=(J,G)=>Rt(J,["id","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},S=()=>{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((me,ue)=>me.disabled&&m.value.includes(o(me,ue))).map((me,ue)=>o(me,ue));if(c.value){const me=G.filter(ue=>!ue.disabled).map((ue,ae)=>o(ue,ae));m.value.splice(0,m.value.length,...me,...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),Q=(J,G)=>J.disabled||L.value&&!m.value.includes(o(J,G)),k=J=>{d.value=J.value,h.value=J.height},D=J=>({"line-size":!0,"is-medium":d.value==="medium",active:J.value===d.value}),A={marginRight:"12px"},V=()=>x.map(J=>a.createVNode("span",{class:D(J),onClick:()=>k(J)},[J.label])),E=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:S},[a.createVNode(ac,{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(Ks,{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:!!E.value,modelValue:m.value.length>0},{default:()=>[i.value.setting.fields.selectAll]})])]),a.createVNode(Ic,{class:"setting-body-fields",modelValue:m.value,"onUpdate:modelValue":G=>m.value=G},Z3(J=C.value.map((G,ie)=>{let me;return a.createVNode("div",{class:"field-item"},[a.createVNode(Xn,{checked:m.value.includes(o(G,ie)),label:o(G,ie),disabled:Q(G,ie)},Z3(me=Rt(G,["name","label"],[G,ie]))?me:{default:()=>[me]})])}))?J:{default:()=>[J]}),R.value?a.createVNode("div",{class:"setting-body-line-height"},[i.value.setting.lineHeight.title,a.createTextVNode(":"),V()]):""]),a.createVNode("div",{class:"setting-footer"},[a.createVNode(At,{theme:"primary",style:A,onClick:T},{default:()=>[i.value.setting.options.ok]}),a.createVNode(At,{style:A,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+ks(C),0),right:(v=!0)=>t.filter(y=>!y.isHidden&&y.fixed==="right").reduce((y,C,b)=>v&&b===0?y:y+ks(C),n?Mr:0)},c=(v,y,C=0)=>{const b=y[Kn.COL_UID],T=v==="right"?-1:1,N=t.filter(x=>!x.isHidden),{length:S}=N;let w=v==="right"?S*T:1,I=0;for(w;;){w=w+-1*T;const x=Math.abs(w),L=N[x],Q=s(L),k=L[Kn.COL_UID];if(Q===v&&b!==k){const D=ks(L);I=I+D}if(b===k)break}return I+C},u=(v,y=!1)=>{if(!v.fixed||v.isHidden)return{};const C={left:0,right:y?Mr:0},b=s(v);return C[b]=c(b,v,C[b]),{[b]:`${C[b]}px`}},f=v=>({width:`${o[v](!1)}px`,backgroundColor:e.thead.color,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 Y3(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}class uT{constructor(t,n,i,s,o,c){Se(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])});Se(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]);Se(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 rT(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=n1(u,d,s)}),this.emitEvent(Rn.ON_SETTING_CHANGE,[i])};return[this.props.settings?a.createVNode(cT,{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(sT,{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(Ot.PAGE_LIMIT_CHANGE,t)}handlePageChange(t){Object.assign(this.props.pagination,{current:t,value:t}),this.context.emit(Ot.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(Ot.COLUMN_PICK,this.propActiveCols)),n.sort&&!n.filter){const i=Rt(n,["field","type"],[n,t]),s=r1(this.reactiveProp.defaultSort[i]);Object.assign(this.reactiveProp.defaultSort,{[i]:s});const o=a1(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(lT,{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(Ot.COLUMN_FILTER_SAVE,{column:t,values:o})};return a.createVNode(oT,{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`,backgroundColor:this.props.thead.color},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(Fe.ROW_SELECTION_ALL);return this.renderCheckboxColumn({[Fe.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(G3,{class:C,title:y,observerResize:this.props.observerResize,resizerWay:this.props.resizerWay},Y3(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:`${Mr+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=[...ws(this.props.rowStyle,[s,o,this]),{"--row-height":`${this.getRowHeight(s,o)}px`}],u=[...ws(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:t1(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 S;const h=[n(f),...ws(this.props.cellStyle,[f,d,s,o,this])],m={"expand-cell":f.type==="expand"},{colspan:v,rowspan:y}=i1(f,d,s,o),C=Fe.ROW_SKIP_CFG,b=f[Kn.COL_UID],{skipRow:T=!1,skipCol:N=!1}=((S=s[C])==null?void 0:S[b])??{};if(!T&&!N){let w;const I=[this.getColumnClass(f,d),this.getColumnCustomClass(f,s),f.align||this.props.align,...ws(this.props.cellClass,[f,d,s,o,this]),{"expand-row":s[Fe.ROW_EXPAND],"is-last":o+y>=i}],x=(L,Q)=>{const k={event:L,row:Ds(s),column:o1(f),cell:{getValue:()=>this.renderCell(s,f,o,t)},rowIndex:o,columnIndex:d};this.context.emit(Q,k)};return a.createVNode("td",{class:I,style:h,colspan:v,rowspan:y,onClick:L=>x(L,Ot.CELL_CLICK),onDblclick:L=>x(L,Ot.CELL_DBL_CLICK)},[a.createVNode(G3,{class:m,column:f,row:s,parentSetting:this.props.showOverflowTooltip,observerResize:this.props.observerResize},Y3(w=this.renderCell(s,f,o,t))?w:{default:()=>[w]})])}return null})])]}),this.renderExpandRow(s,u,o)]})])}renderExpandRow(t,n,i){if(!!t[Fe.ROW_EXPAND]){const o=[...n,{row_expend:!0}],u=`${aT(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,Ds(t)))??a.createVNode("div",{class:"expand-cell-ctx"},[a.createTextVNode("Expand Row")])])])]}})}}handleRowClick(t,n,i,s){this.context.emit(Ot.ROW_CLICK,t,n,i,s,this)}handleRowDblClick(t,n,i,s){this.context.emit(Ot.ROW_DBL_CLICK,t,n,i,s,this)}handleRowEnter(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_ENTER,t,n,i,s,this)}handleRowLeave(t,n,i,s){this.context.emit(Ot.ROW_MOUSE_LEAVE,t,n,i,s,this)}getExpandCell(t){return!!t[Fe.ROW_EXPAND]?a.createVNode(Xs,null,null):a.createVNode(no,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[Fe.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(Fe.ROW_SELECTION_INDETERMINATE),c=vl(this.props,{row:t,index:n,isCheckAll:i});return a.createVNode(Xn,{onChange:s,disabled:!c,modelValue:t[Fe.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=ze({active:this.isColActive(n)}),s=`${tT(ks(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:[]}}),U3=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):[],dT=(e,t)=>{let n=a.reactive([]);const{getColumns:i}=jc(e,t);if(e.columnPick==="disabled")return{activeColumns:n};const s=a.reactive(U3(e)),o=()=>i().map((c,u)=>({index:u,_column:c,active:s.some(f=>f===u)}));return a.watchEffect(()=>{n=o();const c=U3(e);n.forEach((u,f)=>{Object.assign(u,{active:c.some(d=>d===f)})})}),{activeColumns:n}},fT=(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,Q=Number(f.minWidth);f.resizeWidth=L>Q?L:Q,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=>rt.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 S=a.computed(()=>({position:"absolute",top:0,bottom:0,left:0,width:"1px","background-color":"#ebeef5"}));return{registerResizeEvent:T,resetResizeEvents:N,dragOffsetX:h,dragOffsetXStyle:S}},hT=(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(()=>ze({[Gt("table")]:!0,"has-footer":f.value,"has-scroll-y":u.value||e.virtualEnabled},nT(e.border))),m=ze({[Gt("table-head")]:!0,"has-settings":!!e.settings}),v=a.computed(()=>o()),y=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":`${i.scrollTranslateY}px`})),C=a.computed(()=>({"--var-scroll-left":`${i.scrollTranslateX}px`,"--var-scroll-top":"0px",right:d.value?`${Mr-2}px`:"0px"})),b=Gd(e),T=a.computed(()=>({"--row-height":`${Rt(b,"height",["thead"])}px`,"--scroll-head-left":`-${i.scrollTranslateX}px`,"--scroll-left":`${i.scrollTranslateX}px`})),N={[Gt("table-body")]:!0},S=a.computed(()=>ze({[Gt("table-footer")]:!0,"is-hidden":!e.pagination||!e.data.length})),w=()=>e.height==="number"?`${e.height}px`:typeof e.height=="string"?e.height:"",I=()=>{if(v.value.every(R=>/^\d+\.?\d*(px)?$/ig.test(`${R.width}`))){const R=v.value.reduce((G,ie)=>G+Number(`${ie.width}`.replace(/px/ig,"")),0),J=u.value?Mr:0;return`${R+J}px`}return"100%"},x=a.computed(()=>({minHeight:Xm(e.minHeight,"auto"),width:I(),maxWidth:"100%",height:w()})),L=(R,J)=>{const G=String(R);if(/^\d+\.?\d*$/.test(G))return Number(G);if(/^\d+\.?\d*px$/ig.test(G))return Number(G.replace("px",""));if(/^\d+\.?\d*%$/ig.test(G)&&typeof J=="number"){const ie=Number(G.replace("%",""));return J*ie/100}return J},Q=a.reactive({display:"","min-height":"",height:"",maxHeight:""}),k=()=>e.showHead?L(e.headHeight,Pa):0,D=()=>{const R=L(e.height,c.value),J=k(),G=L(e.minHeight,c.value),ie=e.pagination&&e.data.length?e.paginationHeight:0,me=R-J-ie,ue=e.height!=="auto"?`${me}px`:!1,ae=G-J-ie,ge=L(e.maxHeight,void 0),B=typeof ge=="number"?`${ge-J-ie}px`:!1;Object.assign(Q,{display:s!=null&&s.length?"block":!1,"min-height":`${ae}px`,height:ue,maxHeight:B})};a.onMounted(()=>{A(n==null?void 0:n.value)});const A=R=>{if(R){const{height:J}=R.parentElement.getBoundingClientRect();c.value=J,D(),V(R)}},V=R=>{if(!R)return;const J=e.virtualEnabled?`.${Gt("virtual-section")}`:`.${Gt("table-body-content")}`,G=R.querySelector(`.${Gt("table-body")}`);u.value=iT(G,J,0)};return{tableClass:h,headClass:m,contentClass:N,footerClass:S,wrapperStyle:x,contentStyle:Q,headStyle:T,offsetXVarStyle:y,headOffsetXVarStyle:C,resetTableHeight:A,updateBorderClass:V,getColumnsWidthOffsetWidth:()=>{let R=0;return u.value&&(R=R+Mr),e.border.includes(Dl.OUTER)&&!e.border.includes(Dl.NONE)&&(R=R+2),R},hasFooter:f,hasScrollY:u,hasScrollYRef:d}},gT=(e,t)=>{var q,oe;const n=a.reactive([]),{getColumns:i}=jc(e,t),s=W=>{if(/^\d+/.test(`${W.minWidth}`))return W.minWidth;let _=za;return W.sort&&(_=_+18),W.filter&&(_=_+28),_},o=a.computed(()=>i()),c=W=>{var ee,fe;const _=(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:n1($,K,_),[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}=fT(n,!0),{activeColumns:m}=dT(e,t);a.watch(()=>[e.settings],()=>{var W;(((W=e.settings)==null?void 0:W.checked)||[]).length&&c()});const v=rt.debounce(()=>{c(),d(),h()},120);a.watch(()=>o,()=>{v()},{immediate:!0,deep:!0});const y=e.columns.reduce((W,_,$)=>{const ee=Rt(_,["field","type"],[_,$]),fe=s1(_.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:(q=e.settings)==null?void 0:q.size,height:pl[(oe=e.settings)==null?void 0:oe.size]},defaultSort:y||e.defaultSort}),b=W=>{var _;return C.rowActions.has(W)?(_=C.rowActions.get(W))==null?void 0:_.isExpand:!1},T=()=>{Array.isArray(C.defaultSort)&&C.defaultSort.splice(0),C.defaultSort=y||e.defaultSort},N=(W,_=void 0)=>{const $=W[Fe.ROW_UID],ee=typeof _=="boolean"?_:!b($);C.rowActions.set($,Object.assign({},C.rowActions.get($)??{},{isExpand:ee})),ae()},S=()=>C.rowActions.has(Fe.ROW_SELECTION_ALL)?C.rowActions.get(Fe.ROW_SELECTION_ALL):e.selectionKey?E.every(W=>A(W)):!1,w=W=>{const _=W[Fe.ROW_UID],{isSelected:$=!1}=C.rowActions.get(_)||{};return $},I=(W=w)=>{let _=!1,$=!1;E.forEach(ee=>{const fe=W(ee);!_&&!fe&&(_=!0),!$&&fe&&($=!0)}),C.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,$&&_),C.rowActions.set(Fe.ROW_SELECTION_ALL,$&&!_)},x=()=>e.columns.some(W=>W.type==="selection"),L=()=>{x()&&I(W=>A(W))},Q=(W=void 0)=>{const _=typeof W=="boolean"?W:!S();C.rowActions.set(Fe.ROW_SELECTION_ALL,_),C.rowActions.set(Fe.ROW_SELECTION_INDETERMINATE,!1),E.forEach(($,ee)=>{if(vl(e,{row:$,index:ee,isCheckAll:!1})){const fe=$[Fe.ROW_UID],K=Object.assign({},C.rowActions.get(fe)??{},{isSelected:_});C.rowActions.set(fe,K)}}),I(),ae(_),Z(null,W,!0)},k=()=>{Q(!1)},D=(W,_)=>{const $=W[Fe.ROW_UID];if($){const ee=typeof _=="boolean"?_:!V(W,$),fe=Object.assign({},C.rowActions.get($)??{},{isSelected:ee});C.rowActions.set($,fe),_||C.rowActions.set(Fe.ROW_SELECTION_ALL,!1),I(),ae(),Z(W,_,!1)}},A=(W,_=$=>w($))=>typeof e.isSelectedFn=="function"?Reflect.apply(e.isSelectedFn,void 0,[{row:W,data:e.data}]):typeof e.selectionKey=="string"&&e.selectionKey.length?rt.get(W,e.selectionKey):_(W),V=(W,_,$)=>A(W,()=>{var fe;const ee=_===void 0?W[Fe.ROW_UID]:_;return vl(e,{row:W,index:$,isCheckAll:!1})&&S()?!0:C.rowActions.has(ee)?(fe=C.rowActions.get(ee))==null?void 0:fe.isSelected:!1}),E=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")),me=(W=!1)=>{let _=null;const $={},ee=e.data.map(fe=>({[Fe.ROW_UID]:Vi.v4(),...fe}));if(R.value||J.value||G.value||ie.value){const fe=ee.map((K,de)=>{const be=e1(K,e,de);_=be;const Ie={...K,[Fe.ROW_UID]:K[Fe.ROW_UID]||be,[Fe.ROW_SOURCE_DATA]:{...K}};if(R.value){const De=ge(K,be,de,$,_);Object.assign(Ie,{[Fe.ROW_SKIP_CFG]:De})}return J.value&&Object.assign(Ie,{[Fe.ROW_SELECTION]:V(K,be,de)}),ie.value&&Object.assign(Ie,{[Fe.ROW_INDEX]:de}),G.value&&Object.assign(Ie,{[Fe.ROW_EXPAND]:W?b(be):!1}),Ie});E.length=0,E.push(...fe),J.value&&L();return}E.length=0,E.push(...ee)},ue=(W,_,$,ee)=>{const fe=V($,$[Fe.ROW_UID],ee);return W&&typeof _=="boolean"?_:fe},ae=W=>{if(R.value||J.value||G.value||ie.value){let _=null;const $={};E.forEach((ee,fe)=>{const K=ee[Fe.ROW_UID];if(G.value&&Object.assign(ee,{[Fe.ROW_EXPAND]:b(ee[Fe.ROW_UID])}),R.value){const de=ge(ee,K,fe,$,_);_=ee[Fe.ROW_UID],Object.assign(ee,{[Fe.ROW_SKIP_CFG]:de})}if(ie.value&&Object.assign(ee,{[Fe.ROW_INDEX]:fe}),J.value){const de=vl(e,{row:ee,index:fe,isCheckAll:!1});Object.assign(ee,{[Fe.ROW_SELECTION]:ue(de,W,ee,fe)})}}),J.value&&typeof W!="boolean"&&L();return}},ge=(W,_,$,ee,fe)=>{let K=0;const de=ee[fe]??{};return ee[_]||(ee[_]={}),n.forEach((be,Ie)=>{var Le;const{colspan:De,rowspan:Re}=i1(be,Ie,W,$),Ve=be[Kn.COL_UID],ce=((Le=de[Ve])==null?void 0:Le.skipRowLen)??0,Ce={[Ve]:{skipRowLen:0,skipRow:!1,skipCol:!1,skipColLen:0}};K>0&&(Ce[Ve].skipColLen=K,Ce[Ve].skipCol=!0,K=K-1),ce>1?(Ce[Ve].skipRowLen=ce-1,Ce[Ve].skipRow=!0):Re>1&&(Ce[Ve].skipRowLen=Re,Ce[Ve].skipRow=!1),De>1&&(Ce[Ve].skipColLen=De,K=De-1),Object.assign(ee[_],{...Ce})}),ee[_]},B=rt.debounce(ae,120);a.watch([R,J,G,ie],()=>{B()});const Z=(W,_,$=!1)=>{if(e.asyncData&&e.rowKey){if($)e.data.forEach(ee=>{rt.has(ee,e.selectionKey)&&rt.set(ee,e.selectionKey,!!_)});else if(rt.has(W,e.selectionKey)){const ee=e.data.find(fe=>rt.get(fe,e.rowKey)===rt.get(W,e.rowKey));rt.set(ee,e.selectionKey,!!_)}}},{fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,fixedWrapperClass:X}=Zd(e,n,!1);return{colgroups:n,dragOffsetXStyle:u,dragOffsetX:f,reactiveSchema:C,indexData:E,fixedWrapperClass:X,fixedColumns:H,resolveColumnStyle:z,resolveColumnClass:Y,initIndexData:me,updateIndexData:ae,setRowExpand:N,updateColGroups:c,clearSelection:k,toggleAllSelection:Q,toggleRowSelection:D,getSelection:()=>E.filter(W=>V(W)),clearSort:T}},mT=a.defineComponent({name:"Table",props:hL,emits:xL,setup(e,t){const n=ft("table");let i=null,s=null,o=null;const c=new pL,u=a.reactive([]),{initColumns:f}=jc(e,u);a.provide(Wm,f),a.provide(Hm,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:S,resolveColumnClass:w,setRowExpand:I,initIndexData:x,fixedWrapperClass:L,clearSelection:Q,toggleAllSelection:k,toggleRowSelection:D,getSelection:A,clearSort:V,updateColGroups:E}=gT(e,u),{pageData:R,localPagination:J,resolvePageData:G,watchEffectFn:ie}=SL(e,T),{tableClass:me,headClass:ue,contentClass:ae,footerClass:ge,wrapperStyle:B,contentStyle:Z,headStyle:H,hasScrollYRef:z,offsetXVarStyle:Y,headOffsetXVarStyle:X,updateBorderClass:re,resetTableHeight:q,getColumnsWidthOffsetWidth:oe,hasFooter:W}=hT(e,u,d,b,R),{resolveClassName:_}=ye(),$=a.computed(()=>({hasScrollY:z.value})),ee=new uT(e,t,b,v,$,n),fe=()=>{const Ge=d.value.querySelector(`.${_("table-body-content")}`),Ae=Ge.querySelector("table");if(Ae){const Ze=Ae.scrollWidth,Pe=Ge.clientWidth;m.value=Ze-Pe}};a.watch(()=>[e.data,e.pagination,e.height,e.maxHeight,e.minHeight],()=>{x(e.reserveExpand),ie(o,i,s),a.nextTick(()=>{q(d.value),re(d.value)})},{immediate:!0,deep:!0}),a.watchEffect(()=>{if((d==null?void 0:d.value)instanceof HTMLElement){const Ge=oe();gd(d.value,v,20,Ge),fe()}}),ee.on(Rn.ON_SORT_BY_CLICK,Ge=>{const{sortFn:Ae,column:Ze,index:Pe,type:ct}=Ge;typeof Ae=="function"&&(i=Ae,s=Ze,Object.assign(s,{[Kn.SORT_TYPE]:ct}),G(o,i,s)),t.emit(Ot.COLUMN_SORT,{column:a.unref(Ze[Kn.COL_SOURCE_DATA]),index:Pe,type:ct})}).on(Rn.ON_FILTER_CLICK,Ge=>{const{filterFn:Ae,checked:Ze,column:Pe,index:ct}=Ge;typeof Ae=="function"&&(o=Ae,G(o,i,s)),t.emit(Ot.COLUMN_FILTER,{checked:Ze,column:a.unref(Pe[Kn.COL_SOURCE_DATA]),index:ct})}).on(Rn.ON_SETTING_CHANGE,Ge=>{const{checked:Ae=[],size:Ze,height:Pe,fields:ct}=Ge;a.nextTick(()=>{E({checked:Ae,fields:ct}),re(d.value);const _t=oe();Ae.length&&gd(d.value,v,za,_t),t.emit(Ot.SETTING_CHANGE,{checked:Ae,size:Ze,height:Pe,fields:ct})})}).on(Rn.ON_ROW_EXPAND_CLICK,Ge=>{const{row:Ae,column:Ze,index:Pe,rows:ct,e:_t}=Ge;t.emit(Ot.ROW_EXPAND_CLICK,{row:Ds(Ae),column:o1(Ze),index:Pe,rows:ct,e:_t}),I(Ae,!Ae[Fe.ROW_EXPAND])}).on(Rn.ON_ROW_CHECK,({row:Ge,isAll:Ae,index:Ze,value:Pe})=>{Ae?(k(Pe),t.emit(Ot.ROW_SELECT_ALL,{checked:Pe,data:e.data})):(D(Ge,Pe),t.emit(Ot.ROW_SELECT,{row:Ds(Ge),index:Ze,checked:Pe,data:e.data})),t.emit(Ot.ROW_SELECT_CHANGE,{row:Ds(Ge),isAll:Ae,index:Ze,checked:Pe,data:e.data})});const K=Ge=>{const Ae=b.pos.bottom??0,Ze=Ge[1],{translateX:Pe,translateY:ct,pos:_t={}}=Ze;b.scrollTranslateY=ct,b.scrollTranslateX=Pe,b.pos=_t;const{bottom:pa}=_t;pa<=2&&Ae>pa&&Gs(60,()=>{t.emit(Ot.SCROLL_BOTTOM,{..._t,translateX:Pe,translateY:ct})},!0)(),fe()},de=(Ge={left:0,top:0})=>{var Ae,Ze;(Ze=(Ae=h.value)==null?void 0:Ae.scrollTo)==null||Ze.call(Ae,Ge)};a.onMounted(()=>{if(e.observerResize){let Ge=qm(d.value,()=>{if(!d.value)return;e.height==="100%"||e.height,re(d.value);const Ae=oe();gd(d.value,v,20,Ae)},180,!0,e.resizerWay);Ge.start(),a.onBeforeUnmount(()=>{Ge.disconnect(),Ge=null})}}),a.onBeforeUnmount(()=>{ee.destroy()});const be=()=>d.value;t.expose({setRowExpand:I,clearSelection:Q,toggleAllSelection:k,toggleRowSelection:D,getSelection:A,clearSort:V,scrollTo:de,getRoot:be});const Ie=a.computed(()=>({...ae,"__is-empty":!R.length})),De=a.computed(()=>({[_("table-body-content")]:!0,[_("stripe")]:e.stripe,"with-virtual-render":e.virtualEnabled})),Re={column_drag_line:!0,"offset-x":!0},Ve=a.computed(()=>({...y.value,left:`${C.value-b.scrollTranslateX}px`})),ce={"scroll-loading":!0,_bottom:!0},Ce=a.computed(()=>({[_("fixed-bottom-border")]:!0,"_is-empty":!e.data.length})),Le={zIndex:-1,width:0,height:0,display:"none"},Je=a.computed(()=>({"--footer-height":W.value?`${e.paginationHeight}px`:"0"})),{renderScrollLoading:it}=kL(e,t),tt=a.computed(()=>e.virtualEnabled?{}:{scrollXName:"",scrollYName:""}),ot=a.computed(()=>({"--prepend-left":`${b.scrollTranslateX}px`,position:"sticky",top:0,zIndex:2,...e.prependStyle||{}})),Mt=()=>N.value.map(({isExist:Ge,colPos:Ae,column:Ze})=>Ge?"":a.createVNode("div",{class:w(Ze,b.scrollTranslateX,m.value),style:S(Ae)},null)),ht=()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:Ce.value},null),a.createVNode("div",{class:L,style:Y.value},[Mt(),a.createVNode("div",{class:Re,style:Ve.value},null),a.createVNode("div",{class:ce},[it()])])]),vt=()=>t.slots.prepend?a.createVNode("div",{style:ot.value,class:"prepend-row"},[t.slots.prepend()]):null;return()=>{var Ge,Ae;return a.createVNode("div",{class:me.value,style:B.value,ref:d},[a.createVNode("div",{class:ue,style:H.value},[[ee.renderTableHeadSchema(),a.createVNode("div",{class:L,style:X.value},[Mt()])]]),a.createVNode($r,a.mergeProps({ref:h,lineHeight:ee.getRowHeight,class:Ie.value,style:Z,list:R},tt.value,{contentClassName:De.value,onContentScroll:K,throttleDelay:0,scrollEvent:!0,rowKey:e.rowKey,enabled:e.virtualEnabled,keepAlive:!0}),{beforeContent:()=>vt(),default:Ze=>ee.renderTableBodySchema(Ze.data||R),afterSection:()=>ht()}),a.createVNode("div",{class:ge.value,style:Je.value},[W.value&&ee.renderTableFooter(J.value)]),a.createVNode("div",{style:Le},[(Ae=(Ge=t.slots).default)==null?void 0:Ae.call(Ge)])])}}}),l1=Xt(mT,{Column:mL}),gr=12;function pT(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 vT(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 K3=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},c1=(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}},X3=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])])}}),yT=()=>({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:ke("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:()=>({})}}),CT=a.defineComponent({name:"TagRender",directives:{bkTooltips:Fr},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=Kb(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]])}}),bT=a.defineComponent({name:"TagInput",directives:{bkTooltips:Fr},props:yT(),emits:["update:modelValue","change","select","focus","blur","remove","removeAll","input"],setup(e,{emit:t}){const n=ei(),i=ft("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}=pT(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),S=a.computed(()=>!e.disabled&&e.hasDeleteIcon),w=a.computed(()=>e.maxData===1),I=a.computed(()=>k.selectedTagList.length===0&&m.value===""&&!s.isEdit),x=a.computed(()=>e.placeholder||i.value.placeholder),L=a.computed(()=>e.clearable&&!e.disabled&&k.selectedTagList.length!==0&&(e.showClearOnlyHover?s.isHover:!0)),Q=a.computed(()=>({[`${c("tag-input-trigger")}`]:!0,active:s.isEdit,disabled:e.disabled})),k=a.reactive({localList:[],tagListCache:[],selectedTagList:[],selectedTagListCache:[]}),D=a.computed(()=>k.selectedTagList.map(ce=>ce[e.saveKey])),{flatList:A,saveKeyMap:V}=vT(e),E=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([()=>A.value],()=>{a.nextTick(()=>{me()})},{deep:!0}),a.watch(()=>e.modelValue,ce=>{var Ce;ge(D.value,ce)||(a.nextTick(()=>{me()}),e.withValidate&&((Ce=n==null?void 0:n.validate)==null||Ce.call(n,"change")))}),a.watch(m,rt.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(()=>{me()});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 Je=f.curPage+1;Je<=f.totalPage&&(f.isPageLoading=!0,setTimeout(()=>{h(Je)},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&&(k.tagListCache=[...D.value],k.selectedTagListCache=[...k.selectedTagList],m.value=k.selectedTagListCache[0][e.saveKey],De(k.selectedTagList[0],0),Y()),s.isEdit=!0,a.nextTick(()=>{var Ce;(Ce=v.value)==null||Ce.focus(),e.trigger==="focus"&&k.localList.length!==0&&(ue(),o.isShow?R():o.isShow=!0)})}},me=()=>{const{saveKey:ce,modelValue:Ce,displayKey:Le,allowCreate:Je,trigger:it,isAsyncList:tt}=e;if(k.selectedTagList=[],k.localList=A.value,Ce.length){const ot={};k.selectedTagList=Ce.map(Mt=>{const ht=V.value[Mt];return ot[Mt]=1,!ht&&Je?{[ce]:Mt,[Le]:Mt}:ht}).filter(Mt=>Mt),w.value||(k.localList=k.localList.filter(Mt=>!ot[Mt[ce]]))}if(tt&&m.value){ue(m.value),f.curPageList.length&&(o.isShow=!0);return}it==="focus"&&ue()},ue=(ce="")=>{const{searchKey:Ce,filterCallback:Le}=e,Je=ce.toLowerCase().trim();if(Je===""){d(k.localList);return}let it=[];typeof Le=="function"?it=Le(Je,Ce,k.localList)||[]:Array.isArray(Ce)?it=k.localList.filter(tt=>Ce.some(ot=>tt[ot].toLowerCase().indexOf(Je)>-1)):it=k.localList.filter(tt=>tt[Ce].toLowerCase().indexOf(Je)>-1),d(it)},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 ge(ce,Ce){return ce.length!==Ce.length?!1:Ce.every((Le,Je)=>ce[Je]===Le)}const B=()=>{k.tagListCache=[],k.selectedTagListCache=[],k.selectedTagList=[]},Z=()=>{m.value=""},H=()=>{if(w.value)return 0;const Ce=G().findIndex(({id:Le})=>Le==="tagInputItem");return Ce>=0?Ce:0},z=(ce,Ce,Le=!1)=>{if(!Ce||!ce)return;let Je=Ce;Le&&(Je=Ce.nextElementSibling||null),Ce.parentNode.insertBefore(ce,Je)},Y=ce=>{const{maxData:Ce,trigger:Le,allowCreate:Je}=e;if(Ce===-1||Ce>D.value.length){const{value:it}=ce!=null&&ce.target?ce.target:m,tt=K3(it);tt?(ue(it),v.value.style.width=`${tt*gr}px`):Le==="focus"&&ue()}else re(),m.value="",o.isShow=!1;s.isEdit=!0,s.focusItemIndex=Je?-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]=k.tagListCache;ce&&ce===Le&&k.selectedTagListCache.length?Ie(k.selectedTagListCache[0],"select"):W("remove")}else if(e.allowAutoMatch&&ce){const Le=f.curPageList.find(Je=>Array.isArray(e.searchKey)?e.searchKey.map(tt=>Je[tt]).includes(ce):Je[e.searchKey]===ce);Le?q(Le,"select"):e.allowCreate&&q(ce,"custom")}o.isShow=!1,t("blur",ce,D.value),(Ce=n==null?void 0:n.validate)==null||Ce.call(n,"blur")},200)},q=(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(),De(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)},_=ce=>{ce.stopPropagation();const Ce=k.selectedTagList;k.selectedTagList=[];const Le=Ce.filter(Je=>V.value[Je[e.saveKey]]);(e.allowCreate&&Le.length!==0||!e.allowCreate)&&!w.value&&k.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 Je=Le.yAxis+Le.height-ce.yAxis;Je>ce.height&&(T.value.scrollTop=T.value.scrollTop+Je-ce.height)})},ee=(ce,Ce)=>{const Le=G();z(b.value,Le[ce-1]),k.selectedTagList.splice(ce-1,1),ie();const Je=V.value[Ce[e.saveKey]];(e.allowCreate&&Je||!e.allowCreate)&&!w.value&&k.localList.push(Ce),v.value=`${gr}px`,W("remove")},fe=ce=>{if(f.isPageLoading)return;let Ce;const Le=ce.target.value,Je=K3(Le),it=H(),tt=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,!Je){if(it<1)return;z(b.value,tt[it-1]),ie()}break;case"ArrowRight":if(s.isEdit=!0,!Je){if(it===tt.length-1)return;z(tt[it+1],b.value),ie()}break;case"Enter":case"NumpadEnter":!e.allowCreate&&o.isShow||e.allowCreate&&s.focusItemIndex>=0&&o.isShow?q(f.curPageList[s.focusItemIndex],"select",ce):e.allowCreate&&m.value.trim()&&q(m.value,"custom",ce),ce.preventDefault();break;case"Backspace":it!==0&&!m.value&&(Ce=k.selectedTagList[it-1],ee(it,Ce));break}},K=ce=>{const Ce=[],Le=ce.split(";"),Je=/^[a-zA-Z][a-zA-Z_]*/g;return Le.forEach(it=>{const tt=it.match(Je);if(tt){const ot=tt.join("");Ce.push({[e.saveKey]:ot,[e.displayKey]:ot})}}),Ce},de=ce=>{if(ce.preventDefault(),w.value)return!1;const{maxData:Ce,saveKey:Le,displayKey:Je,pasteFn:it,allowCreate:tt}=e,ot=ce.clipboardData.getData("text");let ht=(it?it(ot):K(ot)).map(vt=>vt[Le]);if(ht.length){const vt=G(),Ge=H(),Ae=k.localList.map(Pe=>Pe[Le]);if(ht=ht.filter(Pe=>{const ct=(Pe==null?void 0:Pe.trim())&&!D.value.includes(Pe);return tt?ct:ct&&Ae.includes(Pe)}),Ce!==-1){const Pe=k.selectedTagList.length;if(Pe<Ce){const ct=Ce-Pe;ht.length>ct&&(ht=[...ht.slice(0,ct)])}else ht=[]}const Ze=tt?ht.map(Pe=>k.localList.find(_t=>_t[Le]===Pe)??{[Le]:Pe,[Je]:Pe}):k.localList.filter(Pe=>ht.includes(Pe[Le]));ht.length&&(k.selectedTagList.splice(Ge,0,...Ze),z(b.value,vt[Ge]),v.value.style.width=`${gr}px`,k.localList=k.localList.filter(Pe=>!ht.includes(Pe[Le])),W("select"),ie())}},be=ce=>{e.disabled||(z(b.value,ce.currentTarget,!0),v.value.style.width=`${gr}px`,o.isShow&&R())},Ie=(ce,Ce)=>{if(k.selectedTagList.length>=e.maxData&&e.maxData!==-1)return;const{separator:Le,saveKey:Je,displayKey:it,createTagValidator:tt}=e,ot=H();let Mt=1,ht=!1,vt;const Ge=Ae=>typeof tt=="function"?tt(Ae):!0;if(Ce==="custom")if(Le){let Ae=ce.split(Le);Ae=Ae.filter(Pe=>(Pe==null?void 0:Pe.trim())&&!D.value.includes(Pe)&&Ge(Pe));const Ze=Ae.map(Pe=>V.value[Pe]||{[Je]:Pe,[it]:Pe});Ae.length&&(k.selectedTagList.splice(ot,0,...Ze),Mt=Ze.length,ht=!0)}else{const Ae=typeof ce=="object";if(vt=Ae?ce[Je]:ce.trim(),vt=vt.replace(/\s+/g,""),vt!==void 0&&!D.value.includes(vt)&&Ge(vt)){const Ze=V.value[vt]||(Ae?ce:{[Je]:vt,[it]:vt});k.selectedTagList.splice(ot,0,Ze),ht=!0}}else ce&&(vt=ce[Je],vt!==void 0&&!D.value.includes(vt)&&(k.selectedTagList.splice(ot,0,ce),ht=!0));ht&&a.nextTick(()=>{for(let Ae=1;Ae<=Mt;Ae++){const Pe=G()[ot+Ae];z(Pe,b.value)}if(v.value.style.width=`${gr}px`,!w.value){e.allowNextFocus&&ie();const Ae=D.value.reduce((Ze,Pe)=>(Ze[Pe]=1,Ze),{});k.localList=k.localList.filter(Ze=>!Ae[Ze[Je]])}})},De=(ce,Ce)=>{k.selectedTagList.splice(Ce,1);const Le=V.value[ce[e.saveKey]];(e.allowCreate&&Le||!e.allowCreate)&&!w.value&&k.localList.push(ce)},Re=a.computed(()=>e.collapseTags?e.collapseTags&&!s.isEdit:e.collapseTags),{overflowTagIndex:Ve}=c1(y,Re,D);return{popoverProps:o,...a.toRefs(s),...a.toRefs(k),...a.toRefs(f),isShowPlaceholder:I,isShowClear:L,placeholderText:x,curInputValue:m,renderList:E,showTagClose:S,tagInputRef:v,bkTagSelectorRef:y,tagListRef:C,tagInputItemRef:b,selectorListRef:T,triggerClass:Q,overflowTagIndex:Ve,localCollapseTags:Re,focusInputTrigger:ie,activeClass:ae,handleInput:Y,handleFocus:X,handleBlur:re,handleTagSelected:q,handleTagRemove:oe,handleClear:_,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(CT,{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(X3,{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(X3,{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(la,{theme:"primary",size:Qa.Small},null)]):null])])})])}}),u1=Ue(bT),wT={direction:xg(),align:Dd().def(Il.CENTER),color:p.string.def("#dde4eb"),width:p.number.def(1),type:Sg()},NT=a.defineComponent({name:"Divider",props:wT,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])}}),d1=Ue(NT);var Al=(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))(Al||{}),js=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e))(js||{});const f1=ke("position",{}).def("top");var h1=(e=>(e.REPLACE="replace",e.INSERT="insert",e))(h1||{});const g1=ke("sortType",{}).def("replace"),MT={tabAdd:{type:Function,default:()=>({})},tabChange:{type:Function,default:e=>e},tabRemove:{type:Function,default:e=>e},tabSort:{type:Function,default:()=>({})},tabDrag:{type:Function,default:()=>({})}},IT={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},LT={active:p.oneOfType([p.number,p.string]).def(""),type:ke("type",{}).def("border-card"),tabPosition:f1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g1,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")},TT={active:p.oneOfType([p.number,p.string]).def(""),type:ke("type",{}).def("border-card"),activeBarColor:p.string.def("#3a84ff"),activeBarSize:p.number.def(2),panels:{type:Array,default:()=>[]},tabPosition:f1,closable:Boolean,addable:Boolean,sortable:Boolean,sortType:g1,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),...MT},q3=a.defineComponent({name:"TabNav",directives:{bkTooltips:Fr},props:TT,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([js.LEFT,js.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===js.LEFT?y.right=0:y.left=0,y}if(e.type===Al.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:S,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:S,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:S,tabLabel:w}=b,I=()=>{const L=[this.resolveClassName("tab-header-item")];return S&&L.push(this.resolveClassName("tab-header--disabled")),e===N&&L.push(this.resolveClassName("tab-header--active")),L.join(" ")},x=(L,Q)=>!S&&(L||Q);return a.withDirectives(a.createVNode("div",{key:N,onClick:()=>!S&&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(to,{style:"display:flex;",width:26,height:26},null)])),b.length?a.createVNode("div",{class:this.resolveClassName("tab-header-operation")},[b.map((S,w)=>a.createVNode("div",{class:this.resolveClassName("tab-header-item"),key:w},[S]))]):null},v=()=>this.type===Al.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])}}),xT=a.defineComponent({name:"Tab",components:{TabNav:q3},props:LT,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===h1.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===js.TOP?s.push(this.resolveClassName(`tab--${this.tabPosition}`),this.resolveClassName(`tab--${this.type}`)):(s.push(this.resolveClassName(`tab--${this.tabPosition}`)),this.type===Al.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:S,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:Q}=this,k={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:S,tabAdd:w,tabChange:I,tabRemove:x,tabSort:L,tabDrag:Q};return!s||!Array.isArray(s)?null:a.createVNode(q3,k,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)])])}}),ST=a.defineComponent({name:"TabPanel",props:IT,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]])}}),m1=Xt(xT,{TabPanel:ST}),aa={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]};let e6=1;const p1=(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;aa[i].forEach(v=>{c+=(v.el.offsetHeight||0)+u}),e6+=1;const f=`message_${e6}`;n={...n,offsetX:o,offsetY:c,id:f};const d=document.createElement("div"),h=a.createVNode(e,n);h.props.onDestroy=v=>{kT(v,i,u,s),a.render(null,d)},a.render(h,d),aa[i].push(h);let m;h.props.getContainer&&Ra(h.props.getContainer)?m=h.props.getContainer:m=document.body,m.appendChild(d.firstElementChild)};function kT(e,t,n,i){i==null||i();const s=t.startsWith("top")?"top":"bottom";let o=-1;aa[t].forEach((d,h)=>{d.props.id===e&&(o=h)});const u=aa[t][o].el.offsetHeight,f=aa[t].length;for(let d=o;d<f;d++){const h=parseInt(aa[t][d].el.style[s],10)-u-n;aa[t][d].component.props.offsetY=h}aa[t].splice(o,1)}var v1={exports:{}};/*!
67
67
  * clipboard.js v2.0.11
68
68
  * https://clipboardjs.com/
69
69
  *