import{d as oe,r as m,y as x,ax as la,ay as oa,az as tt,m as sa,i as bt,aA as ia,a7 as da,aj as xe,aB as ua,aC as ca,aD as fa,aE as ba,a as le,aF as pa,n as i,p as v,q as C,D as I,aG as va,aH as Ne,G as at,aI as He,s as Ye,v as ge,aJ as ga,aK as rt,ac as ma,k as we,au as De,K as pt,A as ha,H as Q,aL as ya,ab as xa,L as H,aM as _e,M as Je,ae as wa,ap as Ca,at as Sa,aN as Ta,aO as _a,af as ze,aP as vt,W as za,ah as Ra,a5 as de,o as te,b as ye,f as s,w as u,h as o,e as S,g as T,c as Re,ak as $e,a3 as qe,t as F,aQ as $a,B as Pa,aR as Pe,a8 as ka}from"./index-BJD7BFLS.js";import{M,B as ue,T as ae,I as je,O as nt,D as Fe,a as Aa}from"./index-DR269vK4.js";import{D as lt}from"./index-B_6x9awX.js";import{F as Ba,a as Oa}from"./index-CsGHXsrB.js";import{C as ne,a as La,G as Wa,T as ot}from"./index-tLM7xysn.js";import{G as Ea,a as Ia}from"./index-BekCP-pf.js";import{T as Va}from"./index-Stnr9KzS.js";import{c as Na,N as Ha}from"./index-_z56Lj0y.js";import{a as Da,i as qa,g as gt,w as mt,v as ht,t as yt,n as xt,e as Xe,q as wt,r as Ct,s as St,m as Tt,f as _t,y as zt,u as ja,b as Fa,c as Ua,d as Ma,o as Ga,h as Xa,j as Ka,k as Ya,l as Ja,p as Qa,x as Za}from"./isTypedArray-B1rZa9GE.js";import{t as er}from"./throttle-DmI5yQ5w.js";import{g as ke}from"./get-BbDDeVzm.js";import{N as tr}from"./Spin-DAeNWeu4.js";import{N as ar,a as rr}from"./Flex-CMmms5TP.js";import{N as nr,a as Ae}from"./CollapseItem-BbXbtF9-.js";import"./vue.runtime.esm-bundler-Bq_JOG-p.js";import"./index-BVSAzRjT.js";import"./index-UU4FlV3Q.js";import"./Popselect-D5MN8Kyb.js";import"./get-slot-Bk_rJcZu.js";const lr=tt(".v-x-scroll",{overflow:"auto",scrollbarWidth:"none"},[tt("&::-webkit-scrollbar",{width:0,height:0})]),or=oe({name:"XScroll",props:{disabled:Boolean,onScroll:Function},setup(){const e=x(null);function n(l){!(l.currentTarget.offsetWidth<l.currentTarget.scrollWidth)||l.deltaY===0||(l.currentTarget.scrollLeft+=l.deltaY+l.deltaX,l.preventDefault())}const b=la();return lr.mount({id:"vueuc/x-scroll",head:!0,anchorMetaName:oa,ssr:b}),Object.assign({selfRef:e,handleWheel:n},{scrollTo(...l){var g;(g=e.value)===null||g===void 0||g.scrollTo(...l)}})},render(){return m("div",{ref:"selfRef",onScroll:this.onScroll,onWheel:this.disabled?void 0:this.handleWheel,class:"v-x-scroll"},this.$slots)}}),Qe=sa("n-tabs"),Rt={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},sr=oe({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:Rt,slots:Object,setup(e){const n=bt(Qe,null);return n||ia("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:n.paneStyleRef,class:n.paneClassRef,mergedClsPrefix:n.mergedClsPrefixRef}},render(){return m("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),ir=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},pa(Rt,["displayDirective"])),Ke=oe({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:ir,setup(e){const{mergedClsPrefixRef:n,valueRef:b,typeRef:d,closableRef:l,tabStyleRef:g,addTabStyleRef:c,tabClassRef:y,addTabClassRef:_,tabChangeIdRef:k,onBeforeLeaveRef:z,triggerRef:$,handleAdd:O,activateTab:W,handleClose:R}=bt(Qe);return{trigger:$,mergedClosable:le(()=>{if(e.internalAddable)return!1;const{closable:A}=e;return A===void 0?l.value:A}),style:g,addStyle:c,tabClass:y,addTabClass:_,clsPrefix:n,value:b,type:d,handleClose(A){A.stopPropagation(),!e.disabled&&R(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){O();return}const{name:A}=e,D=++k.id;if(A!==b.value){const{value:q}=z;q?Promise.resolve(q(e.name,b.value)).then(E=>{E&&k.id===D&&W(A)}):W(A)}}}},render(){const{internalAddable:e,clsPrefix:n,name:b,disabled:d,label:l,tab:g,value:c,mergedClosable:y,trigger:_,$slots:{default:k}}=this,z=l??g;return m("div",{class:`${n}-tabs-tab-wrapper`},this.internalLeftPadded?m("div",{class:`${n}-tabs-tab-pad`}):null,m("div",Object.assign({key:b,"data-name":b,"data-disabled":d?!0:void 0},da({class:[`${n}-tabs-tab`,c===b&&`${n}-tabs-tab--active`,d&&`${n}-tabs-tab--disabled`,y&&`${n}-tabs-tab--closable`,e&&`${n}-tabs-tab--addable`,e?this.addTabClass:this.tabClass],onClick:_==="click"?this.activateTab:void 0,onMouseenter:_==="hover"?this.activateTab:void 0,style:e?this.addStyle:this.style},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),m("span",{class:`${n}-tabs-tab__label`},e?m(xe,null,m("div",{class:`${n}-tabs-tab__height-placeholder`}," "),m(ua,{clsPrefix:n},{default:()=>m(ca,null)})):k?k():typeof z=="object"?z:fa(z??b)),y&&this.type==="card"?m(ba,{clsPrefix:n,class:`${n}-tabs-tab__close`,onClick:this.handleClose,disabled:d}):null))}}),dr=i("tabs",`
 box-sizing: border-box;
 width: 100%;
 display: flex;
 flex-direction: column;
 transition:
 background-color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
`,[v("segment-type",[i("tabs-rail",[C("&.transition-disabled",[i("tabs-capsule",`
 transition: none;
 `)])])]),v("top",[i("tab-pane",`
 padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left);
 `)]),v("left",[i("tab-pane",`
 padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top);
 `)]),v("left, right",`
 flex-direction: row;
 `,[i("tabs-bar",`
 width: 2px;
 right: 0;
 transition:
 top .2s var(--n-bezier),
 max-height .2s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `),i("tabs-tab",`
 padding: var(--n-tab-padding-vertical); 
 `)]),v("right",`
 flex-direction: row-reverse;
 `,[i("tab-pane",`
 padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom);
 `),i("tabs-bar",`
 left: 0;
 `)]),v("bottom",`
 flex-direction: column-reverse;
 justify-content: flex-end;
 `,[i("tab-pane",`
 padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left);
 `),i("tabs-bar",`
 top: 0;
 `)]),i("tabs-rail",`
 position: relative;
 padding: 3px;
 border-radius: var(--n-tab-border-radius);
 width: 100%;
 background-color: var(--n-color-segment);
 transition: background-color .3s var(--n-bezier);
 display: flex;
 align-items: center;
 `,[i("tabs-capsule",`
 border-radius: var(--n-tab-border-radius);
 position: absolute;
 pointer-events: none;
 background-color: var(--n-tab-color-segment);
 box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
 transition: transform 0.3s var(--n-bezier);
 `),i("tabs-tab-wrapper",`
 flex-basis: 0;
 flex-grow: 1;
 display: flex;
 align-items: center;
 justify-content: center;
 `,[i("tabs-tab",`
 overflow: hidden;
 border-radius: var(--n-tab-border-radius);
 width: 100%;
 display: flex;
 align-items: center;
 justify-content: center;
 `,[v("active",`
 font-weight: var(--n-font-weight-strong);
 color: var(--n-tab-text-color-active);
 `),C("&:hover",`
 color: var(--n-tab-text-color-hover);
 `)])])]),v("flex",[i("tabs-nav",`
 width: 100%;
 position: relative;
 `,[i("tabs-wrapper",`
 width: 100%;
 `,[i("tabs-tab",`
 margin-right: 0;
 `)])])]),i("tabs-nav",`
 box-sizing: border-box;
 line-height: 1.5;
 display: flex;
 transition: border-color .3s var(--n-bezier);
 `,[I("prefix, suffix",`
 display: flex;
 align-items: center;
 `),I("prefix","padding-right: 16px;"),I("suffix","padding-left: 16px;")]),v("top, bottom",[C(">",[i("tabs-nav",[i("tabs-nav-scroll-wrapper",[C("&::before",`
 top: 0;
 bottom: 0;
 left: 0;
 width: 20px;
 `),C("&::after",`
 top: 0;
 bottom: 0;
 right: 0;
 width: 20px;
 `),v("shadow-start",[C("&::before",`
 box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
 `)]),v("shadow-end",[C("&::after",`
 box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
 `)])])])])]),v("left, right",[i("tabs-nav-scroll-content",`
 flex-direction: column;
 `),C(">",[i("tabs-nav",[i("tabs-nav-scroll-wrapper",[C("&::before",`
 top: 0;
 left: 0;
 right: 0;
 height: 20px;
 `),C("&::after",`
 bottom: 0;
 left: 0;
 right: 0;
 height: 20px;
 `),v("shadow-start",[C("&::before",`
 box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
 `)]),v("shadow-end",[C("&::after",`
 box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12);
 `)])])])])]),i("tabs-nav-scroll-wrapper",`
 flex: 1;
 position: relative;
 overflow: hidden;
 `,[i("tabs-nav-y-scroll",`
 height: 100%;
 width: 100%;
 overflow-y: auto; 
 scrollbar-width: none;
 `,[C("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
 width: 0;
 height: 0;
 display: none;
 `)]),C("&::before, &::after",`
 transition: box-shadow .3s var(--n-bezier);
 pointer-events: none;
 content: "";
 position: absolute;
 z-index: 1;
 `)]),i("tabs-nav-scroll-content",`
 display: flex;
 position: relative;
 min-width: 100%;
 min-height: 100%;
 width: fit-content;
 box-sizing: border-box;
 `),i("tabs-wrapper",`
 display: inline-flex;
 flex-wrap: nowrap;
 position: relative;
 `),i("tabs-tab-wrapper",`
 display: flex;
 flex-wrap: nowrap;
 flex-shrink: 0;
 flex-grow: 0;
 `),i("tabs-tab",`
 cursor: pointer;
 white-space: nowrap;
 flex-wrap: nowrap;
 display: inline-flex;
 align-items: center;
 color: var(--n-tab-text-color);
 font-size: var(--n-tab-font-size);
 background-clip: padding-box;
 padding: var(--n-tab-padding);
 transition:
 box-shadow .3s var(--n-bezier),
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 `,[v("disabled",{cursor:"not-allowed"}),I("close",`
 margin-left: 6px;
 transition:
 background-color .3s var(--n-bezier),
 color .3s var(--n-bezier);
 `),I("label",`
 display: flex;
 align-items: center;
 z-index: 1;
 `)]),i("tabs-bar",`
 position: absolute;
 bottom: 0;
 height: 2px;
 border-radius: 1px;
 background-color: var(--n-bar-color);
 transition:
 left .2s var(--n-bezier),
 max-width .2s var(--n-bezier),
 opacity .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 `,[C("&.transition-disabled",`
 transition: none;
 `),v("disabled",`
 background-color: var(--n-tab-text-color-disabled)
 `)]),i("tabs-pane-wrapper",`
 position: relative;
 overflow: hidden;
 transition: max-height .2s var(--n-bezier);
 `),i("tab-pane",`
 color: var(--n-pane-text-color);
 width: 100%;
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 opacity .2s var(--n-bezier);
 left: 0;
 right: 0;
 top: 0;
 `,[C("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",`
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 transform .2s var(--n-bezier),
 opacity .2s var(--n-bezier);
 `),C("&.next-transition-leave-active, &.prev-transition-leave-active",`
 position: absolute;
 `),C("&.next-transition-enter-from, &.prev-transition-leave-to",`
 transform: translateX(32px);
 opacity: 0;
 `),C("&.next-transition-leave-to, &.prev-transition-enter-from",`
 transform: translateX(-32px);
 opacity: 0;
 `),C("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",`
 transform: translateX(0);
 opacity: 1;
 `)]),i("tabs-tab-pad",`
 box-sizing: border-box;
 width: var(--n-tab-gap);
 flex-grow: 0;
 flex-shrink: 0;
 `),v("line-type, bar-type",[i("tabs-tab",`
 font-weight: var(--n-tab-font-weight);
 box-sizing: border-box;
 vertical-align: bottom;
 `,[C("&:hover",{color:"var(--n-tab-text-color-hover)"}),v("active",`
 color: var(--n-tab-text-color-active);
 font-weight: var(--n-tab-font-weight-active);
 `),v("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),i("tabs-nav",[v("line-type",[v("top",[I("prefix, suffix",`
 border-bottom: 1px solid var(--n-tab-border-color);
 `),i("tabs-nav-scroll-content",`
 border-bottom: 1px solid var(--n-tab-border-color);
 `),i("tabs-bar",`
 bottom: -1px;
 `)]),v("left",[I("prefix, suffix",`
 border-right: 1px solid var(--n-tab-border-color);
 `),i("tabs-nav-scroll-content",`
 border-right: 1px solid var(--n-tab-border-color);
 `),i("tabs-bar",`
 right: -1px;
 `)]),v("right",[I("prefix, suffix",`
 border-left: 1px solid var(--n-tab-border-color);
 `),i("tabs-nav-scroll-content",`
 border-left: 1px solid var(--n-tab-border-color);
 `),i("tabs-bar",`
 left: -1px;
 `)]),v("bottom",[I("prefix, suffix",`
 border-top: 1px solid var(--n-tab-border-color);
 `),i("tabs-nav-scroll-content",`
 border-top: 1px solid var(--n-tab-border-color);
 `),i("tabs-bar",`
 top: -1px;
 `)]),I("prefix, suffix",`
 transition: border-color .3s var(--n-bezier);
 `),i("tabs-nav-scroll-content",`
 transition: border-color .3s var(--n-bezier);
 `),i("tabs-bar",`
 border-radius: 0;
 `)]),v("card-type",[I("prefix, suffix",`
 transition: border-color .3s var(--n-bezier);
 `),i("tabs-pad",`
 flex-grow: 1;
 transition: border-color .3s var(--n-bezier);
 `),i("tabs-tab-pad",`
 transition: border-color .3s var(--n-bezier);
 `),i("tabs-tab",`
 font-weight: var(--n-tab-font-weight);
 border: 1px solid var(--n-tab-border-color);
 background-color: var(--n-tab-color);
 box-sizing: border-box;
 position: relative;
 vertical-align: bottom;
 display: flex;
 justify-content: space-between;
 font-size: var(--n-tab-font-size);
 color: var(--n-tab-text-color);
 `,[v("addable",`
 padding-left: 8px;
 padding-right: 8px;
 font-size: 16px;
 justify-content: center;
 `,[I("height-placeholder",`
 width: 0;
 font-size: var(--n-tab-font-size);
 `),va("disabled",[C("&:hover",`
 color: var(--n-tab-text-color-hover);
 `)])]),v("closable","padding-right: 8px;"),v("active",`
 background-color: #0000;
 font-weight: var(--n-tab-font-weight-active);
 color: var(--n-tab-text-color-active);
 `),v("disabled","color: var(--n-tab-text-color-disabled);")])]),v("left, right",`
 flex-direction: column; 
 `,[I("prefix, suffix",`
 padding: var(--n-tab-padding-vertical);
 `),i("tabs-wrapper",`
 flex-direction: column;
 `),i("tabs-tab-wrapper",`
 flex-direction: column;
 `,[i("tabs-tab-pad",`
 height: var(--n-tab-gap-vertical);
 width: 100%;
 `)])]),v("top",[v("card-type",[i("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);"),I("prefix, suffix",`
 border-bottom: 1px solid var(--n-tab-border-color);
 `),i("tabs-tab",`
 border-top-left-radius: var(--n-tab-border-radius);
 border-top-right-radius: var(--n-tab-border-radius);
 `,[v("active",`
 border-bottom: 1px solid #0000;
 `)]),i("tabs-tab-pad",`
 border-bottom: 1px solid var(--n-tab-border-color);
 `),i("tabs-pad",`
 border-bottom: 1px solid var(--n-tab-border-color);
 `)])]),v("left",[v("card-type",[i("tabs-scroll-padding","border-right: 1px solid var(--n-tab-border-color);"),I("prefix, suffix",`
 border-right: 1px solid var(--n-tab-border-color);
 `),i("tabs-tab",`
 border-top-left-radius: var(--n-tab-border-radius);
 border-bottom-left-radius: var(--n-tab-border-radius);
 `,[v("active",`
 border-right: 1px solid #0000;
 `)]),i("tabs-tab-pad",`
 border-right: 1px solid var(--n-tab-border-color);
 `),i("tabs-pad",`
 border-right: 1px solid var(--n-tab-border-color);
 `)])]),v("right",[v("card-type",[i("tabs-scroll-padding","border-left: 1px solid var(--n-tab-border-color);"),I("prefix, suffix",`
 border-left: 1px solid var(--n-tab-border-color);
 `),i("tabs-tab",`
 border-top-right-radius: var(--n-tab-border-radius);
 border-bottom-right-radius: var(--n-tab-border-radius);
 `,[v("active",`
 border-left: 1px solid #0000;
 `)]),i("tabs-tab-pad",`
 border-left: 1px solid var(--n-tab-border-color);
 `),i("tabs-pad",`
 border-left: 1px solid var(--n-tab-border-color);
 `)])]),v("bottom",[v("card-type",[i("tabs-scroll-padding","border-top: 1px solid var(--n-tab-border-color);"),I("prefix, suffix",`
 border-top: 1px solid var(--n-tab-border-color);
 `),i("tabs-tab",`
 border-bottom-left-radius: var(--n-tab-border-radius);
 border-bottom-right-radius: var(--n-tab-border-radius);
 `,[v("active",`
 border-top: 1px solid #0000;
 `)]),i("tabs-tab-pad",`
 border-top: 1px solid var(--n-tab-border-color);
 `),i("tabs-pad",`
 border-top: 1px solid var(--n-tab-border-color);
 `)])])])]),Ue=er,ur=Object.assign(Object.assign({},ge.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:String,placement:{type:String,default:"top"},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),cr=oe({name:"Tabs",props:ur,slots:Object,setup(e,{slots:n}){var b,d,l,g;const{mergedClsPrefixRef:c,inlineThemeDisabled:y,mergedComponentPropsRef:_}=Ye(e),k=ge("Tabs","-tabs",dr,ga,e,c),z=x(null),$=x(null),O=x(null),W=x(null),R=x(null),A=x(null),D=x(!0),q=x(!0),E=rt(e,["labelSize","size"]),Z=le(()=>{var a,r;if(E.value)return E.value;const f=(r=(a=_?.value)===null||a===void 0?void 0:a.Tabs)===null||r===void 0?void 0:r.size;return f||"medium"}),J=rt(e,["activeName","value"]),w=x((d=(b=J.value)!==null&&b!==void 0?b:e.defaultValue)!==null&&d!==void 0?d:n.default?(g=(l=Ne(n.default())[0])===null||l===void 0?void 0:l.props)===null||g===void 0?void 0:g.name:null),B=ma(J,w),U={id:0},se=le(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});we(B,()=>{U.id=0,X(),Ce()});function ce(){var a;const{value:r}=B;return r===null?null:(a=z.value)===null||a===void 0?void 0:a.querySelector(`[data-name="${r}"]`)}function Oe(a){if(e.type==="card")return;const{value:r}=$;if(!r)return;const f=r.style.opacity==="0";if(a){const h=`${c.value}-tabs-bar--disabled`,{barWidth:L,placement:K}=e;if(a.dataset.disabled==="true"?r.classList.add(h):r.classList.remove(h),["top","bottom"].includes(K)){if(ee(["top","maxHeight","height"]),typeof L=="number"&&a.offsetWidth>=L){const Y=Math.floor((a.offsetWidth-L)/2)+a.offsetLeft;r.style.left=`${Y}px`,r.style.maxWidth=`${L}px`}else r.style.left=`${a.offsetLeft}px`,r.style.maxWidth=`${a.offsetWidth}px`;r.style.width="8192px",f&&(r.style.transition="none"),r.offsetWidth,f&&(r.style.transition="",r.style.opacity="1")}else{if(ee(["left","maxWidth","width"]),typeof L=="number"&&a.offsetHeight>=L){const Y=Math.floor((a.offsetHeight-L)/2)+a.offsetTop;r.style.top=`${Y}px`,r.style.maxHeight=`${L}px`}else r.style.top=`${a.offsetTop}px`,r.style.maxHeight=`${a.offsetHeight}px`;r.style.height="8192px",f&&(r.style.transition="none"),r.offsetHeight,f&&(r.style.transition="",r.style.opacity="1")}}}function Le(){if(e.type==="card")return;const{value:a}=$;a&&(a.style.opacity="0")}function ee(a){const{value:r}=$;if(r)for(const f of a)r.style[f]=""}function X(){if(e.type==="card")return;const a=ce();a?Oe(a):Le()}function Ce(){var a;const r=(a=R.value)===null||a===void 0?void 0:a.$el;if(!r)return;const f=ce();if(!f)return;const{scrollLeft:h,offsetWidth:L}=r,{offsetLeft:K,offsetWidth:Y}=f;h>K?r.scrollTo({top:0,left:K,behavior:"smooth"}):K+Y>h+L&&r.scrollTo({top:0,left:K+Y-L,behavior:"smooth"})}const ie=x(null);let re=0,j=null;function me(a){const r=ie.value;if(r){re=a.getBoundingClientRect().height;const f=`${re}px`,h=()=>{r.style.height=f,r.style.maxHeight=f};j?(h(),j(),j=null):j=h}}function We(a){const r=ie.value;if(r){const f=a.getBoundingClientRect().height,h=()=>{document.body.offsetHeight,r.style.maxHeight=`${f}px`,r.style.height=`${Math.max(re,f)}px`};j?(j(),j=null,h()):j=h}}function Ee(){const a=ie.value;if(a){a.style.maxHeight="",a.style.height="";const{paneWrapperStyle:r}=e;if(typeof r=="string")a.style.cssText=r;else if(r){const{maxHeight:f,height:h}=r;f!==void 0&&(a.style.maxHeight=f),h!==void 0&&(a.style.height=h)}}}const Se={value:[]},P=x("next");function t(a){const r=B.value;let f="next";for(const h of Se.value){if(h===r)break;if(h===a){f="prev";break}}P.value=f,V(a)}function V(a){const{onActiveNameChange:r,onUpdateValue:f,"onUpdate:value":h}=e;r&&ze(r,a),f&&ze(f,a),h&&ze(h,a),w.value=a}function p(a){const{onClose:r}=e;r&&ze(r,a)}function N(){const{value:a}=$;if(!a)return;const r="transition-disabled";a.classList.add(r),X(),a.classList.remove(r)}const fe=x(null);function Ie({transitionDisabled:a}){const r=z.value;if(!r)return;a&&r.classList.add("transition-disabled");const f=ce();f&&fe.value&&(fe.value.style.width=`${f.offsetWidth}px`,fe.value.style.height=`${f.offsetHeight}px`,fe.value.style.transform=`translateX(${f.offsetLeft-wa(getComputedStyle(r).paddingLeft)}px)`,a&&fe.value.offsetWidth),a&&r.classList.remove("transition-disabled")}we([B],()=>{e.type==="segment"&&De(()=>{Ie({transitionDisabled:!1})})}),pt(()=>{e.type==="segment"&&Ie({transitionDisabled:!0})});let Ze=0;function $t(a){var r;if(a.contentRect.width===0&&a.contentRect.height===0||Ze===a.contentRect.width)return;Ze=a.contentRect.width;const{type:f}=e;if((f==="line"||f==="bar")&&N(),f!=="segment"){const{placement:h}=e;Ve((h==="top"||h==="bottom"?(r=R.value)===null||r===void 0?void 0:r.$el:A.value)||null)}}const Pt=Ue($t,64);we([()=>e.justifyContent,()=>e.size],()=>{De(()=>{const{type:a}=e;(a==="line"||a==="bar")&&N()})});const be=x(!1);function kt(a){var r;const{target:f,contentRect:{width:h,height:L}}=a,K=f.parentElement.parentElement.offsetWidth,Y=f.parentElement.parentElement.offsetHeight,{placement:ve}=e;if(!be.value)ve==="top"||ve==="bottom"?K<h&&(be.value=!0):Y<L&&(be.value=!0);else{const{value:he}=W;if(!he)return;ve==="top"||ve==="bottom"?K-h>he.$el.offsetWidth&&(be.value=!1):Y-L>he.$el.offsetHeight&&(be.value=!1)}Ve(((r=R.value)===null||r===void 0?void 0:r.$el)||null)}const At=Ue(kt,64);function Bt(){const{onAdd:a}=e;a&&a(),De(()=>{const r=ce(),{value:f}=R;!r||!f||f.scrollTo({left:r.offsetLeft,top:0,behavior:"smooth"})})}function Ve(a){if(!a)return;const{placement:r}=e;if(r==="top"||r==="bottom"){const{scrollLeft:f,scrollWidth:h,offsetWidth:L}=a;D.value=f<=0,q.value=f+L>=h}else{const{scrollTop:f,scrollHeight:h,offsetHeight:L}=a;D.value=f<=0,q.value=f+L>=h}}const Ot=Ue(a=>{Ve(a.target)},64);ha(Qe,{triggerRef:Q(e,"trigger"),tabStyleRef:Q(e,"tabStyle"),tabClassRef:Q(e,"tabClass"),addTabStyleRef:Q(e,"addTabStyle"),addTabClassRef:Q(e,"addTabClass"),paneClassRef:Q(e,"paneClass"),paneStyleRef:Q(e,"paneStyle"),mergedClsPrefixRef:c,typeRef:Q(e,"type"),closableRef:Q(e,"closable"),valueRef:B,tabChangeIdRef:U,onBeforeLeaveRef:Q(e,"onBeforeLeave"),activateTab:t,handleClose:p,handleAdd:Bt}),ya(()=>{X(),Ce()}),xa(()=>{const{value:a}=O;if(!a)return;const{value:r}=c,f=`${r}-tabs-nav-scroll-wrapper--shadow-start`,h=`${r}-tabs-nav-scroll-wrapper--shadow-end`;D.value?a.classList.remove(f):a.classList.add(f),q.value?a.classList.remove(h):a.classList.add(h)});const Lt={syncBarPosition:()=>{X()}},Wt=()=>{Ie({transitionDisabled:!0})},et=le(()=>{const{value:a}=Z,{type:r}=e,f={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[r],h=`${a}${f}`,{self:{barColor:L,closeIconColor:K,closeIconColorHover:Y,closeIconColorPressed:ve,tabColor:he,tabBorderColor:Et,paneTextColor:It,tabFontWeight:Vt,tabBorderRadius:Nt,tabFontWeightActive:Ht,colorSegment:Dt,fontWeightStrong:qt,tabColorSegment:jt,closeSize:Ft,closeIconSize:Ut,closeColorHover:Mt,closeColorPressed:Gt,closeBorderRadius:Xt,[H("panePadding",a)]:Te,[H("tabPadding",h)]:Kt,[H("tabPaddingVertical",h)]:Yt,[H("tabGap",h)]:Jt,[H("tabGap",`${h}Vertical`)]:Qt,[H("tabTextColor",r)]:Zt,[H("tabTextColorActive",r)]:ea,[H("tabTextColorHover",r)]:ta,[H("tabTextColorDisabled",r)]:aa,[H("tabFontSize",a)]:ra},common:{cubicBezierEaseInOut:na}}=k.value;return{"--n-bezier":na,"--n-color-segment":Dt,"--n-bar-color":L,"--n-tab-font-size":ra,"--n-tab-text-color":Zt,"--n-tab-text-color-active":ea,"--n-tab-text-color-disabled":aa,"--n-tab-text-color-hover":ta,"--n-pane-text-color":It,"--n-tab-border-color":Et,"--n-tab-border-radius":Nt,"--n-close-size":Ft,"--n-close-icon-size":Ut,"--n-close-color-hover":Mt,"--n-close-color-pressed":Gt,"--n-close-border-radius":Xt,"--n-close-icon-color":K,"--n-close-icon-color-hover":Y,"--n-close-icon-color-pressed":ve,"--n-tab-color":he,"--n-tab-font-weight":Vt,"--n-tab-font-weight-active":Ht,"--n-tab-padding":Kt,"--n-tab-padding-vertical":Yt,"--n-tab-gap":Jt,"--n-tab-gap-vertical":Qt,"--n-pane-padding-left":_e(Te,"left"),"--n-pane-padding-right":_e(Te,"right"),"--n-pane-padding-top":_e(Te,"top"),"--n-pane-padding-bottom":_e(Te,"bottom"),"--n-font-weight-strong":qt,"--n-tab-color-segment":jt}}),pe=y?Je("tabs",le(()=>`${Z.value[0]}${e.type[0]}`),et,e):void 0;return Object.assign({mergedClsPrefix:c,mergedValue:B,renderedNames:new Set,segmentCapsuleElRef:fe,tabsPaneWrapperRef:ie,tabsElRef:z,barElRef:$,addTabInstRef:W,xScrollInstRef:R,scrollWrapperElRef:O,addTabFixed:be,tabWrapperStyle:se,handleNavResize:Pt,mergedSize:Z,handleScroll:Ot,handleTabsResize:At,cssVars:y?void 0:et,themeClass:pe?.themeClass,animationDirection:P,renderNameListRef:Se,yScrollElRef:A,handleSegmentResize:Wt,onAnimationBeforeLeave:me,onAnimationEnter:We,onAnimationAfterEnter:Ee,onRender:pe?.onRender},Lt)},render(){const{mergedClsPrefix:e,type:n,placement:b,addTabFixed:d,addable:l,mergedSize:g,renderNameListRef:c,onRender:y,paneWrapperClass:_,paneWrapperStyle:k,$slots:{default:z,prefix:$,suffix:O}}=this;y?.();const W=z?Ne(z()).filter(w=>w.type.__TAB_PANE__===!0):[],R=z?Ne(z()).filter(w=>w.type.__TAB__===!0):[],A=!R.length,D=n==="card",q=n==="segment",E=!D&&!q&&this.justifyContent;c.value=[];const Z=()=>{const w=m("div",{style:this.tabWrapperStyle,class:`${e}-tabs-wrapper`},E?null:m("div",{class:`${e}-tabs-scroll-padding`,style:b==="top"||b==="bottom"?{width:`${this.tabsPadding}px`}:{height:`${this.tabsPadding}px`}}),A?W.map((B,U)=>(c.value.push(B.props.name),Me(m(Ke,Object.assign({},B.props,{internalCreatedByPane:!0,internalLeftPadded:U!==0&&(!E||E==="center"||E==="start"||E==="end")}),B.children?{default:B.children.tab}:void 0)))):R.map((B,U)=>(c.value.push(B.props.name),Me(U!==0&&!E?dt(B):B))),!d&&l&&D?it(l,(A?W.length:R.length)!==0):null,E?null:m("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return m("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},D&&l?m(He,{onResize:this.handleTabsResize},{default:()=>w}):w,D?m("div",{class:`${e}-tabs-pad`}):null,D?null:m("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},J=q?"top":b;return m("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${n}-type`,`${e}-tabs--${g}-size`,E&&`${e}-tabs--flex`,`${e}-tabs--${J}`],style:this.cssVars},m("div",{class:[`${e}-tabs-nav--${n}-type`,`${e}-tabs-nav--${J}`,`${e}-tabs-nav`]},at($,w=>w&&m("div",{class:`${e}-tabs-nav__prefix`},w)),q?m(He,{onResize:this.handleSegmentResize},{default:()=>m("div",{class:`${e}-tabs-rail`,ref:"tabsElRef"},m("div",{class:`${e}-tabs-capsule`,ref:"segmentCapsuleElRef"},m("div",{class:`${e}-tabs-wrapper`},m("div",{class:`${e}-tabs-tab`}))),A?W.map((w,B)=>(c.value.push(w.props.name),m(Ke,Object.assign({},w.props,{internalCreatedByPane:!0,internalLeftPadded:B!==0}),w.children?{default:w.children.tab}:void 0))):R.map((w,B)=>(c.value.push(w.props.name),B===0?w:dt(w))))}):m(He,{onResize:this.handleNavResize},{default:()=>m("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(J)?m(or,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:Z}):m("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll,ref:"yScrollElRef"},Z()))}),d&&l&&D?it(l,!0):null,at(O,w=>w&&m("div",{class:`${e}-tabs-nav__suffix`},w))),A&&(this.animated&&(J==="top"||J==="bottom")?m("div",{ref:"tabsPaneWrapperRef",style:k,class:[`${e}-tabs-pane-wrapper`,_]},st(W,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):st(W,this.mergedValue,this.renderedNames)))}});function st(e,n,b,d,l,g,c){const y=[];return e.forEach(_=>{const{name:k,displayDirective:z,"display-directive":$}=_.props,O=R=>z===R||$===R,W=n===k;if(_.key!==void 0&&(_.key=k),W||O("show")||O("show:lazy")&&b.has(k)){b.has(k)||b.add(k);const R=!O("if");y.push(R?Ca(_,[[Sa,W]]):_)}}),c?m(Ta,{name:`${c}-transition`,onBeforeLeave:d,onEnter:l,onAfterEnter:g},{default:()=>y}):y}function it(e,n){return m(Ke,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:n,disabled:typeof e=="object"&&e.disabled})}function dt(e){const n=_a(e);return n.props?n.props.internalLeftPadded=!0:n.props={internalLeftPadded:!0},n}function Me(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const fr=i("h",`
 font-size: var(--n-font-size);
 font-weight: var(--n-font-weight);
 margin: var(--n-margin);
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
`,[C("&:first-child",{marginTop:0}),v("prefix-bar",{position:"relative",paddingLeft:"var(--n-prefix-width)"},[v("align-text",{paddingLeft:0},[C("&::before",{left:"calc(-1 * var(--n-prefix-width))"})]),C("&::before",`
 content: "";
 width: var(--n-bar-width);
 border-radius: calc(var(--n-bar-width) / 2);
 transition: background-color .3s var(--n-bezier);
 left: 0;
 top: 0;
 bottom: 0;
 position: absolute;
 `),C("&::before",{backgroundColor:"var(--n-bar-color)"})])]),br=Object.assign(Object.assign({},ge.props),{type:{type:String,default:"default"},prefix:String,alignText:Boolean}),pr=e=>oe({name:`H${e}`,props:br,setup(n){const{mergedClsPrefixRef:b,inlineThemeDisabled:d}=Ye(n),l=ge("Typography","-h",fr,vt,n,b),g=le(()=>{const{type:y}=n,{common:{cubicBezierEaseInOut:_},self:{headerFontWeight:k,headerTextColor:z,[H("headerPrefixWidth",e)]:$,[H("headerFontSize",e)]:O,[H("headerMargin",e)]:W,[H("headerBarWidth",e)]:R,[H("headerBarColor",y)]:A}}=l.value;return{"--n-bezier":_,"--n-font-size":O,"--n-margin":W,"--n-bar-color":A,"--n-bar-width":R,"--n-font-weight":k,"--n-text-color":z,"--n-prefix-width":$}}),c=d?Je(`h${e}`,le(()=>n.type[0]),g,n):void 0;return{mergedClsPrefix:b,cssVars:d?void 0:g,themeClass:c?.themeClass,onRender:c?.onRender}},render(){var n;const{prefix:b,alignText:d,mergedClsPrefix:l,cssVars:g,$slots:c}=this;return(n=this.onRender)===null||n===void 0||n.call(this),m(`h${e}`,{class:[`${l}-h`,`${l}-h${e}`,this.themeClass,{[`${l}-h--prefix-bar`]:b,[`${l}-h--align-text`]:d}],style:g},c)}}),Be=pr("3"),G=oe({name:"Li",render(){return m("li",null,this.$slots)}}),ut=C("li",{transition:"color .3s var(--n-bezier)",lineHeight:"var(--n-line-height)",margin:"var(--n-li-margin)",marginBottom:0,color:"var(--n-text-color)"}),ct=[C("&:first-child",`
 margin-top: 0;
 `),C("&:last-child",`
 margin-bottom: 0;
 `)],vr=C([i("ol",{fontSize:"var(--n-font-size)",padding:"var(--n-ol-padding)"},[v("align-text",{paddingLeft:0}),ut,ct]),i("ul",{fontSize:"var(--n-font-size)",padding:"var(--n-ul-padding)"},[v("align-text",{paddingLeft:0}),ut,ct])]),gr=Object.assign(Object.assign({},ge.props),{alignText:Boolean}),ft=oe({name:"Ul",props:gr,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:b}=Ye(e),d=ge("Typography","-xl",vr,vt,e,n),l=le(()=>{const{common:{cubicBezierEaseInOut:c},self:{olPadding:y,ulPadding:_,liMargin:k,liTextColor:z,liLineHeight:$,liFontSize:O}}=d.value;return{"--n-bezier":c,"--n-font-size":O,"--n-line-height":$,"--n-text-color":z,"--n-li-margin":k,"--n-ol-padding":y,"--n-ul-padding":_}}),g=b?Je("ul",void 0,l,e):void 0;return{mergedClsPrefix:n,cssVars:b?void 0:l,themeClass:g?.themeClass,onRender:g?.onRender}},render(){var e;const{mergedClsPrefix:n}=this;return(e=this.onRender)===null||e===void 0||e.call(this),m("ul",{class:[`${n}-ul`,this.themeClass,this.alignText&&`${n}-ul--align-text`],style:this.cssVars},this.$slots)}});function mr(e){return Array.isArray(e)}function hr(e){return Da(e)}function yr(e){if(qa(e))return e;const n=gt(e);if(!xr(e))return{};if(mr(e)){const d=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(d.index=e.index,d.input=e.input),d}if(hr(e)){const d=e,l=d.constructor;return new l(d.buffer,d.byteOffset,d.length)}if(n===mt)return new ArrayBuffer(e.byteLength);if(n===ht){const d=e,l=d.buffer,g=d.byteOffset,c=d.byteLength,y=new ArrayBuffer(c),_=new Uint8Array(l,g,c);return new Uint8Array(y).set(_),new DataView(y)}if(n===yt||n===xt||n===Xe){const d=e.constructor,l=new d(e.valueOf());return n===Xe?Cr(l,e):Ge(l,e),l}if(n===wt)return new Date(Number(e));if(n===Ct){const d=e,l=new RegExp(d.source,d.flags);return l.lastIndex=d.lastIndex,l}if(n===St)return Object(Symbol.prototype.valueOf.call(e));if(n===Tt){const d=e,l=new Map;return d.forEach((g,c)=>{l.set(c,g)}),l}if(n===_t){const d=e,l=new Set;return d.forEach(g=>{l.add(g)}),l}if(n===zt){const d=e,l={};return Ge(l,d),l.length=d.length,l[Symbol.iterator]=d[Symbol.iterator],l}const b={};return Sr(b,e),Ge(b,e),wr(b,e),b}function xr(e){switch(gt(e)){case zt:case Za:case mt:case ht:case yt:case wt:case Qa:case Ja:case Ya:case Ka:case Xa:case Tt:case xt:case Ga:case Ct:case _t:case Xe:case St:case Ma:case Ua:case Fa:case ja:return!0;default:return!1}}function Ge(e,n){for(const b in n)Object.hasOwn(n,b)&&(e[b]=n[b])}function wr(e,n){const b=Object.getOwnPropertySymbols(n);for(let d=0;d<b.length;d++){const l=b[d];Object.prototype.propertyIsEnumerable.call(n,l)&&(e[l]=n[l])}}function Cr(e,n){const b=n.valueOf().length;for(const d in n)Object.hasOwn(n,d)&&(Number.isNaN(Number(d))||Number(d)>=b)&&(e[d]=n[d])}function Sr(e,n){const b=Object.getPrototypeOf(n);b!==null&&typeof n.constructor=="function"&&Object.setPrototypeOf(e,b)}ne.install=function(e){e.component(ne.name,ne)};const Tr={style:{"max-width":"80%"}},_r={style:{"margin-top":"10px"}},zr={style:{"margin-top":"10px"}},Rr={style:{"margin-top":"10px"}},$r={style:{"margin-top":"10px"}},Pr={style:{"margin-top":"10px"}},kr={style:{"margin-top":"10px","margin-bottom":"20px"}},Ar={style:{"margin-bottom":"5px"}},Br={style:{"margin-bottom":"5px"}},Or={style:{"margin-bottom":"5px"}},Lr={style:{"margin-left":"10px",width:"300px"}},Wr={style:{"margin-bottom":"5px"}},Er=oe({name:"dataspace",__name:"index",setup(e){const{protocol:n,hostname:b,port:d}=za(),l=`${n}://${b}:${d}`,g=Ra();pt(()=>{g.query.code&&_()});const c=x(!1),y=x({});async function _(){c.value=!0;try{const P=await de({url:`${l}/api/sqliteSource/queryMetaData`,method:"get",params:{code:g.query.code}}),t=P.data.metaData??[];z.value=[],t.forEach((V,p)=>{z.value.push({id:p,label:V.name})}),y.value=P.data.config??{}}catch{c.value=!1,M.error("查询失败")}c.value=!1}function k(P){const t={};for(const V of P)t[V.name]=V.value;return t}const z=x([]),$=x(""),O=x(1),W=x(1);we(O,(P,t)=>{R()});const R=async P=>{if(P&&P.label)$.value=P.label;else if($.value.length==0)return;c.value=!0;try{const t=await de({url:`${l}/api/sqliteSource/filterTableData`,method:"post",data:{code:g.query.code,table:$.value,pageNum:O.value,filter:k(X.value)}});q.value=t.data.fields,E.value=t.data.data,W.value=t.data.total<=10?1:Math.floor(t.data.total/10)+1,A.value&&(X.value=yr(q.value),X.value.push({name:"id",type:"text"}),X.value.push({name:"create_time",type:"text"}),X.value.push({name:"update_time",type:"text"}),A.value=!1),ie.value=Na.createId()}catch{c.value=!1,M.error("查询失败")}c.value=!1},A=x(!1);we($,(P,t)=>{A.value=!0,E.value=[]});const D=x([{code:"insert",name:"新增"},{code:"delete",name:"删除"},{code:"cancel",name:"取消选中"},{code:"save",name:"保存"},{code:"query",name:"刷新"},{code:"filter",name:"条件查询",type:"success"}]),q=x([]),E=x([]),Z=x();async function J({code:P,$grid:t}){const V=t.getSelectRecords(!0),p=t.getUpdateRecords().concat(t.getInsertRecords());switch(P){case"insert":Z.value.insert({});break;case"cancel":{t.clearSelection();break}case"delete":{V.length===0&&ot.alert("请至少选中一条记录"),c.value=!0;try{const N=await de({url:`${l}/api/sqliteSource/deleteTableData`,method:"post",data:{code:g.query.code,table:$.value,items:V}});c.value=!1,M.success("删除成功")}catch{c.value=!1,M.success("删除失败")}t.removeSelecteds();break}case"save":{if(p.length===0){ot.alert("没有修改记录");break}c.value=!0;try{const N=await de({url:`${l}/api/sqliteSource/saveTableData`,method:"post",data:{code:g.query.code,table:$.value,items:p}});c.value=!1,R(),M.success("保存成功")}catch{c.value=!1,M.success("保存失败")}t.clearAll();break}case"query":{R();break}case"filter":{ee.value=!0;break}}}const w=x(!1);async function B(){if(U.value.length==0){M.info("请输入表名");return}if(se.value.length==0){M.info("请填写业务字段");return}try{c.value=!0,await de({url:`${l}/api/sqliteSource/addTable`,method:"post",data:{table:U.value,fields:se.value,code:g.query.code,filename:y.value.filename}}),c.value=!1,M.success("创建成功"),_()}catch{c.value=!1,M.error("创建失败")}w.value=!1,U.value="",se.value=[]}const U=x(""),se=x([]);function ce(){return{name:"",type:"text",disabled:!1}}const Oe=[{label:"integer",value:"integer"},{label:"real",value:"real"},{label:"text",value:"text"},{label:"blob",value:"blob"},{label:"boolean",value:"boolean"},{label:"bigint",value:"bigint"},{label:"numeric",value:"numeric"}];async function Le(){if($.value.length!=0){c.value=!0;try{await de({url:`${l}/api/sqliteSource/dropTable`,method:"get",params:{code:g.query.code,table:$.value}})}catch{c.value=!1,M.error("删除失败")}_(),c.value=!1}}const ee=x(!1),X=x([]);function Ce(){O.value=1,R(),ee.value=!1}const ie=x(),re=x(""),j=x(!1),me=x([]);async function We(){me.value=[];const P=await de({url:`${l}/api/appmanager/queryPage`,method:"get",params:{limit:1e3,offset:0}});P.data&&P.data.forEach(t=>{me.value.push({value:`${ke(t,"appId")}-${ke(t,"appSecret")}`,label:`${ke(t,"appId")}#${ke(t,"remark")}`,disabled:!1})})}async function Ee(){j.value=!0,We()}async function Se(){if(re.value.length==0){M.warning("请选择AppId/AppSecret");return}try{const t=await(await fetch(`${l}/api/openapi/exportSqliteMarkDown`,{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify({base:l,path:`/api/sqlite/${y.value.filename}/`,name:y.value.name,poolCode:y.value.code,toSelectAppId:re.value})})).blob(),V=URL.createObjectURL(t),p=document.createElement("a");p.href=V,p.download=`${y.value.name}-接口文档.md`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(V),j.value=!1}catch{}}return(P,t)=>{const V=sr;return te(),ye("div",null,[s(o(qe),null,{default:u(()=>[s(o(tr),{show:c.value},{default:u(()=>[s(o(cr),{type:"line",size:"small"},{default:u(()=>[s(V,{name:"数据表格"},{default:u(()=>[s(o(ar),{wrap:!1},{default:u(()=>[S("div",null,[s(o(Va),{placeholder:"输入表名称搜索",data:z.value,class:"demo-tree-menu",onNodeClick:R},null,8,["data"]),s(o(ue),{type:"info",onClick:t[0]||(t[0]=p=>w.value=!0)},{default:u(()=>t[10]||(t[10]=[T("创建表")])),_:1,__:[10]}),s(o(La),{style:{"margin-left":"10px"},title:"删除后，该表的数据将丢失，请确认",type:"info",trigger:"click",onConfirm:Le},{reference:u(()=>[s(o(ue),{type:"danger"},{default:u(()=>t[11]||(t[11]=[T("删除表")])),_:1,__:[11]})]),_:1})]),S("div",Tr,[(te(),Re(o(Wa),{key:ie.value,ref_key:"basicGridRef",ref:Z,data:E.value,"edit-config":{trigger:"click",mode:"cell",showStatus:!0,markInsert:!0},onToolbarButtonClick:J,"column-min-width":"200px",size:"small"},{toolbar:u(()=>[s(o(Ea),{buttons:D.value,size:"small"},null,8,["buttons"])]),default:u(()=>[s(o(ne),{type:"selection",width:"50"}),s(o(ne),{field:"id","show-overflow":"",title:"id",width:"230"}),(te(!0),ye(xe,null,$e(q.value,p=>(te(),Re(o(ne),{field:p.name,"show-overflow":"",title:p.name,editor:{component:"input",autoselect:!0}},null,8,["field","title"]))),256)),s(o(ne),{field:"create_time","show-overflow":"",title:"create_time",width:"180"}),s(o(ne),{field:"update_time","show-overflow":"",title:"update_time",width:"180"})]),_:1},8,["data"])),S("div",_r,[s(o(rr),{page:O.value,"onUpdate:page":t[1]||(t[1]=p=>O.value=p),"page-count":W.value},null,8,["page","page-count"])])])]),_:1})]),_:1}),s(V,{name:"REST API 服务"},{default:u(()=>[S("div",null,[s(o(qe),{title:"基础信息",embedded:""},{default:u(()=>[S("p",null,"项目名称："+F(y.value.name),1),S("p",null,"编码："+F(y.value.code),1),S("p",null,"文件名：./.data/"+F(y.value.filename)+".db",1),S("p",null,"创建时间："+F(o($a)(y.value.createdAt)),1),S("p",null,"baseUrl："+F(l)+"/api/sqlite/[数据库文件名]/[表名称]")]),_:1})]),S("div",zr,[s(o(nr),null,{default:u(()=>[s(o(Ae),{title:"查询",name:"1"},{default:u(()=>[S("div",null,[s(o(ae),{type:"sucesss",value:"GET",size:"medium",effect:"dark"}),S("p",Rr,"示例："+F(l)+"/api/sqlite/"+F(y.value.filename)+"/employee?pageNum=1&pageSize=10&order=create_time.asc&age=eq.18",1),s(o(Be),null,{default:u(()=>t[12]||(t[12]=[T("查询参数（Query Parameters）")])),_:1,__:[12]}),s(o(ft),null,{default:u(()=>[s(o(G),null,{default:u(()=>t[13]||(t[13]=[T("pageNum 页码，默认1")])),_:1,__:[13]}),s(o(G),null,{default:u(()=>t[14]||(t[14]=[T("pageSize 分页数据量，默认100")])),_:1,__:[14]}),s(o(G),null,{default:u(()=>t[15]||(t[15]=[T("order 排序，如：create_time.asc")])),_:1,__:[15]})]),_:1}),s(o(Be),null,{default:u(()=>t[16]||(t[16]=[T("操作符（Filter Operators）")])),_:1,__:[16]}),s(o(ft),null,{default:u(()=>[s(o(G),null,{default:u(()=>t[17]||(t[17]=[T("eq 等于，如：status=eq.active")])),_:1,__:[17]}),s(o(G),null,{default:u(()=>t[18]||(t[18]=[T("neq 不等于，如：status=neq.deleted")])),_:1,__:[18]}),s(o(G),null,{default:u(()=>t[19]||(t[19]=[T("gt 大于，如：age=gt.18")])),_:1,__:[19]}),s(o(G),null,{default:u(()=>t[20]||(t[20]=[T("gte 大于或等于，如：price=gte.100")])),_:1,__:[20]}),s(o(G),null,{default:u(()=>t[21]||(t[21]=[T("lt 小于，如：quantity=lt.10")])),_:1,__:[21]}),s(o(G),null,{default:u(()=>t[22]||(t[22]=[T("lte 小于或等于，如：score=lte.50")])),_:1,__:[22]}),s(o(G),null,{default:u(()=>t[23]||(t[23]=[T("like 模糊匹配，如：name=like.%john%")])),_:1,__:[23]}),s(o(G),null,{default:u(()=>t[24]||(t[24]=[T("in 包含，如：status=in.(1,2)")])),_:1,__:[24]}),s(o(G),null,{default:u(()=>t[25]||(t[25]=[T("is 是，如：deleted_at=is.null")])),_:1,__:[25]})]),_:1})])]),_:1}),s(o(Ae),{title:"创建",name:"2"},{default:u(()=>[S("div",null,[s(o(ae),{type:"sucesss",value:"POST",size:"medium",effect:"dark"}),S("p",$r,"示例："+F(l)+"/api/sqlite/"+F(y.value.filename)+"/employee",1),s(o(Be),null,{default:u(()=>t[26]||(t[26]=[T("请求体（数组）")])),_:1,__:[26]}),t[27]||(t[27]=S("p",null,' [ { "name": "liu11", "age": 22, "salary": 231231, "birth": "2026-10" }, { "name": "liu33", "age": 22, "salary": 231231, "birth": "2026-10" } ] ',-1))])]),_:1}),s(o(Ae),{title:"更新",name:"3"},{default:u(()=>[S("div",null,[s(o(ae),{type:"sucesss",value:"PATCH",size:"medium",effect:"dark"}),S("p",Pr,"示例："+F(l)+"/api/sqlite/"+F(y.value.filename)+"/employee",1),s(o(Be),null,{default:u(()=>t[28]||(t[28]=[T("请求体（数组，对象必须包含id字段）")])),_:1,__:[28]}),t[29]||(t[29]=S("p",null,' [ { "id": "u5lzilt2bzwezlzyln80cfk0", "name": "liu11", "age": 33, "salary": 231231, "birth": "2026-10" } ] ',-1))])]),_:1}),s(o(Ae),{title:"删除",name:"4"},{default:u(()=>[S("div",null,[s(o(ae),{type:"sucesss",value:"DELETE",size:"medium",effect:"dark"}),S("p",kr,"示例："+F(l)+"/api/sqlite/"+F(y.value.filename)+"/employee?id=u5lzilt2bzwezlzyln80cfk0",1)])]),_:1})]),_:1})])]),_:1}),s(V,{name:"AI 开发"},{default:u(()=>[s(o(qe),{title:"markdown文档",embedded:""},{action:u(()=>[s(o(Pa),{type:"success",onClick:Ee},{default:u(()=>t[30]||(t[30]=[T(" 下载 ")])),_:1,__:[30]})]),default:u(()=>[t[31]||(t[31]=S("p",null," 文档包含表格字段与类型、REST API使用规范、获取取access token接口，下载后即可让AI完成对接。 ",-1))]),_:1,__:[31]})]),_:1})]),_:1})]),_:1},8,["show"])]),_:1}),s(o(Fe),{visible:w.value,"onUpdate:visible":t[5]||(t[5]=p=>w.value=p),title:"新建表",width:"40vw",top:"50","max-height":"92vh"},{footer:u(()=>[s(o(ue),{type:"success",onClick:B},{default:u(()=>t[36]||(t[36]=[T("确 定")])),_:1,__:[36]}),s(o(ue),{type:"primary",onClick:t[4]||(t[4]=p=>w.value=!w.value)},{default:u(()=>t[37]||(t[37]=[T("关 闭")])),_:1,__:[37]})]),default:u(()=>[S("div",null,[S("div",Ar,[s(o(ae),{type:"info",value:"表名",size:"medium",effect:"dark"})]),s(o(je),{modelValue:U.value,"onUpdate:modelValue":t[2]||(t[2]=p=>U.value=p),placeholder:"表名(字母或数字组成)"},null,8,["modelValue"]),s(o(lt)),S("div",Br,[s(o(ae),{type:"info",value:"字段",size:"medium",effect:"dark"}),s(o(ae),{value:"新建/更新时间自动赋值",size:"medium",effect:"dark",style:{"margin-left":"5px"}})]),S("div",Or,[s(o(Pe),null,{default:u(()=>t[32]||(t[32]=[T(" id ")])),_:1,__:[32]}),s(o(Pe),{style:{"margin-left":"5px"}},{default:u(()=>t[33]||(t[33]=[T(" create_time ")])),_:1,__:[33]}),s(o(Pe),{style:{"margin-left":"5px"}},{default:u(()=>t[34]||(t[34]=[T(" update_time ")])),_:1,__:[34]})]),s(o(Ha),{value:se.value,"onUpdate:value":t[3]||(t[3]=p=>se.value=p),"on-create":ce},{default:u(({value:p})=>[s(o(je),{modelValue:p.name,"onUpdate:modelValue":N=>p.name=N,placeholder:"字段名称(字母或数字组成)"},null,8,["modelValue","onUpdate:modelValue"]),S("div",Lr,[s(o(Ia),{modelValue:p.type,"onUpdate:modelValue":N=>p.type=N},{default:u(()=>[(te(),ye(xe,null,$e(Oe,N=>s(o(nt),{key:N.value,label:N.label,value:N.value},null,8,["label","value"])),64))]),_:2},1032,["modelValue","onUpdate:modelValue"])])]),_:1},8,["value"]),s(o(lt)),S("div",Wr,[s(o(ae),{type:"info",value:"主键字段",size:"medium",effect:"dark"}),s(o(ae),{value:"自动生成唯一值",size:"medium",effect:"dark",style:{"margin-left":"5px"}})]),s(o(Pe),null,{default:u(()=>t[35]||(t[35]=[T(" id ")])),_:1,__:[35]})])]),_:1},8,["visible"]),s(o(Fe),{draggable:"",modal:!1,visible:ee.value,"onUpdate:visible":t[7]||(t[7]=p=>ee.value=p),title:"条件查询",width:"40vw",top:"50","max-height":"92vh"},{footer:u(()=>[s(o(ue),{type:"success",onClick:Ce},{default:u(()=>t[38]||(t[38]=[T("确 定")])),_:1,__:[38]}),s(o(ue),{type:"primary",onClick:t[6]||(t[6]=p=>ee.value=!ee.value)},{default:u(()=>t[39]||(t[39]=[T("关 闭")])),_:1,__:[39]})]),default:u(()=>[S("div",null,[s(o(Ba),null,{default:u(()=>[(te(!0),ye(xe,null,$e(X.value,p=>(te(),Re(o(Oa),{label:p.name,prop:p.name},{default:u(()=>[s(o(je),{modelValue:p.value,"onUpdate:modelValue":N=>p.value=N},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop"]))),256))]),_:1})])]),_:1},8,["visible"]),s(o(Fe),{visible:j.value,"onUpdate:visible":t[9]||(t[9]=p=>j.value=p),title:"选择使用的AppId/AppSecret",width:"30%"},{footer:u(()=>[s(o(ue),{type:"primary",onClick:Se},{default:u(()=>t[40]||(t[40]=[T("确 定")])),_:1,__:[40]})]),default:u(()=>[s(o(Aa),{clearable:"",modelValue:re.value,"onUpdate:modelValue":t[8]||(t[8]=p=>re.value=p),style:{"margin-top":"10px"},searchable:!0},{default:u(()=>[(te(!0),ye(xe,null,$e(me.value,p=>(te(),Re(o(nt),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["visible"])])}}}),an=ka(Er,[["__scopeId","data-v-028d4506"]]);export{an as default};
