p?p:y),h===c.length-1){const w=t.column-v%t.column;f.push(s(m,w,p,!0)),d.push(f);return}y(S(),x("div",{class:E(i(l))},[u.title||u.extra||u.$slots.title||u.$slots.extra?(S(),x("div",{key:0,class:E(i(n).e("header"))},[I("div",{class:E(i(n).e("title"))},[ve(u.$slots,"title",{},()=>[nt(ue(u.title),1)])],2),I("div",{class:E(i(n).e("extra"))},[ve(u.$slots,"extra",{},()=>[nt(ue(u.extra),1)])],2)],2)):oe("v-if",!0),I("div",{class:E(i(n).e("body"))},[I("table",{class:E([i(n).e("table"),i(n).is("bordered",u.border)])},[I("tbody",null,[(S(!0),x(xe,null,lt(a(),(d,f)=>(S(),ae(ZH,{key:f,row:d},null,8,["row"]))),128))])],2)],2)],2))}});var n9=Ne(t9,[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/description.vue"]]),k2=G({name:"ElDescriptionsItem",props:{label:{type:String,default:""},span:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},labelAlign:{type:String,default:""},className:{type:String,default:""},labelClassName:{type:String,default:""}}});const o9=it(n9,{DescriptionsItem:k2}),r9=jt(k2),l9=Me({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:se([String,Array,Object])},zIndex:{type:se([String,Number])}}),s9={click:e=>e instanceof MouseEvent},a9="overlay";var i9=G({name:"ElOverlay",props:l9,emits:s9,setup(e,{slots:t,emit:n}){const o=ye(a9),r=u=>{n("click",u)},{onClick:l,onMousedown:s,onMouseup:a}=rh(e.customMaskEvent?void 0:r);return()=>e.mask?z("div",{class:[o.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:l,onMousedown:s,onMouseup:a},[ve(t,"default")],qn.STYLE|qn.CLASS|qn.PROPS,["onClick","onMouseup","onMousedown"]):je("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[ve(t,"default")])}});const _h=i9,$2=Symbol("dialogInjectionKey"),E2=Me({center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{type:Rt},customClass:{type:String,default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{type:String,default:""}}),u9={close:()=>!0},c9=["aria-label"],d9=["id"],f9=G({name:"ElDialogContent"}),p9=G({...f9,props:E2,emits:u9,setup(e){const t=e,{t:n}=Ct(),{Close:o}=p1,{dialogRef:r,headerRef:l,bodyId:s,ns:a,style:u}=De($2),{focusTrapRef:c}=De(dh),d=ic(c,r),f=C(()=>t.draggable);return g1(r,l,f),(p,v)=>(S(),x("div",{ref:i(d),class:E([i(a).b(),i(a).is("fullscreen",p.fullscreen),i(a).is("draggable",i(f)),i(a).is("align-center",p.alignCenter),{[i(a).m("center")]:p.center},p.customClass]),style:He(i(u)),tabindex:"-1"},[I("header",{ref_key:"headerRef",ref:l,class:E(i(a).e("header"))},[ve(p.$slots,"header",{},()=>[I("span",{role:"heading",class:E(i(a).e("title"))},ue(p.title),3)]),p.showClose?(S(),x("button",{key:0,"aria-label":i(n)("el.dialog.close"),class:E(i(a).e("headerbtn")),type:"button",onClick:v[0]||(v[0]=m=>p.$emit("close"))},[z(i(ze),{class:E(i(a).e("close"))},{default:q(()=>[(S(),ae(vt(p.closeIcon||i(o))))]),_:1},8,["class"])],10,c9)):oe("v-if",!0)],2),I("div",{id:i(s),class:E(i(a).e("body"))},[ve(p.$slots,"default")],10,d9),p.$slots.footer?(S(),x("footer",{key:0,class:E(i(a).e("footer"))},[ve(p.$slots,"footer")],2)):oe("v-if",!0)],6))}});var h9=Ne(p9,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);const T2=Me({...E2,appendToBody:{type:Boolean,default:!1},beforeClose:{type:se(Function)},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:{type:Boolean,default:!1},modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1}}),O2={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[dt]:e=>Xt(e),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},N2=(e,t)=>{const o=ut().emit,{nextZIndex:r}=Sl();let l="";const s=no(),a=no(),u=N(!1),c=N(!1),d=N(!1),f=N(e.zIndex||r());let p,v;const m=mc("namespace",Cu),h=C(()=>{const H={},W=`--${m.value}-dialog`;return e.fullscreen||(e.top&&(H[`${W}-margin-top`]=e.top),e.width&&(H[`${W}-width`]=qt(e.width))),H}),g=C(()=>e.alignCenter?{display:"flex"}:{});function y(){o("opened")}function w(){o("closed"),o(dt,!1),e.destroyOnClose&&(d.value=!1)}function b(){o("close")}function _(){v==null||v(),p==null||p(),e.openDelay&&e.openDelay>0?{stop:p}=pl(()=>O(),e.openDelay):O()}function k(){p==null||p(),v==null||v(),e.closeDelay&&e.closeDelay>0?{stop:v}=pl(()=>P(),e.closeDelay):P()}function $(){function H(W){W||(c.value=!0,u.value=!1)}e.beforeClose?e.beforeClose(H):k()}function M(){e.closeOnClickModal&&$()}function O(){bt&&(u.value=!0)}function P(){u.value=!1}function A(){o("openAutoFocus")}function V(){o("closeAutoFocus")}function B(H){var W;((W=H.detail)==null?void 0:W.focusReason)==="pointer"&&H.preventDefault()}e.lockScroll&&w1(u);function D(){e.closeOnPressEscape&&$()}return me(()=>e.modelValue,H=>{H?(c.value=!1,_(),d.value=!0,f.value=e.zIndex?f.value++:r(),Ke(()=>{o("open"),t.value&&(t.value.scrollTop=0)})):u.value&&k()}),me(()=>e.fullscreen,H=>{t.value&&(H?(l=t.value.style.transform,t.value.style.transform=""):t.value.style.transform=l)}),tt(()=>{e.modelValue&&(u.value=!0,d.value=!0,_())}),{afterEnter:y,afterLeave:w,beforeLeave:b,handleClose:$,onModalClick:M,close:k,doClose:P,onOpenAutoFocus:A,onCloseAutoFocus:V,onCloseRequested:D,onFocusoutPrevented:B,titleId:s,bodyId:a,closed:c,style:h,overlayDialogStyle:g,rendered:d,visible:u,zIndex:f}},v9=["aria-label","aria-labelledby","aria-describedby"],m9=G({name:"ElDialog",inheritAttrs:!1}),g9=G({...m9,props:T2,emits:O2,setup(e,{expose:t}){const n=e,o=cn();Ro({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},C(()=>!!o.title)),Ro({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},C(()=>!!n.customClass));const r=ye("dialog"),l=N(),s=N(),a=N(),{visible:u,titleId:c,bodyId:d,style:f,overlayDialogStyle:p,rendered:v,zIndex:m,afterEnter:h,afterLeave:g,beforeLeave:y,handleClose:w,onModalClick:b,onOpenAutoFocus:_,onCloseAutoFocus:k,onCloseRequested:$,onFocusoutPrevented:M}=N2(n,l);ht($2,{dialogRef:l,headerRef:s,bodyId:d,ns:r,rendered:v,style:f});const O=rh(b),P=C(()=>n.draggable&&!n.fullscreen);return t({visible:u,dialogContentRef:a}),(A,V)=>(S(),ae(Ha,{to:"body",disabled:!A.appendToBody},[z(Yt,{name:"dialog-fade",onAfterEnter:i(h),onAfterLeave:i(g),onBeforeLeave:i(y),persisted:""},{default:q(()=>[et(z(i(_h),{"custom-mask-event":"",mask:A.modal,"overlay-class":A.modalClass,"z-index":i(m)},{default:q(()=>[I("div",{role:"dialog","aria-modal":"true","aria-label":A.title||void 0,"aria-labelledby":A.title?void 0:i(c),"aria-describedby":i(d),class:E(`${i(r).namespace.value}-overlay-dialog`),style:He(i(p)),onClick:V[0]||(V[0]=(...B)=>i(O).onClick&&i(O).onClick(...B)),onMousedown:V[1]||(V[1]=(...B)=>i(O).onMousedown&&i(O).onMousedown(...B)),onMouseup:V[2]||(V[2]=(...B)=>i(O).onMouseup&&i(O).onMouseup(...B))},[z(i(bc),{loop:"",trapped:i(u),"focus-start-el":"container",onFocusAfterTrapped:i(_),onFocusAfterReleased:i(k),onFocusoutPrevented:i(M),onReleaseRequested:i($)},{default:q(()=>[i(v)?(S(),ae(h9,pt({key:0,ref_key:"dialogContentRef",ref:a},A.$attrs,{"custom-class":A.customClass,center:A.center,"align-center":A.alignCenter,"close-icon":A.closeIcon,draggable:i(P),fullscreen:A.fullscreen,"show-close":A.showClose,title:A.title,onClose:i(w)}),Xo({header:q(()=>[A.$slots.title?ve(A.$slots,"title",{key:1}):ve(A.$slots,"header",{key:0,close:i(w),titleId:i(c),titleClass:i(r).e("title")})]),default:q(()=>[ve(A.$slots,"default")]),_:2},[A.$slots.footer?{name:"footer",fn:q(()=>[ve(A.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","onClose"])):oe("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,v9)]),_:3},8,["mask","overlay-class","z-index"]),[[kt,i(u)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"]))}});var y9=Ne(g9,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);const b9=it(y9),w9=Me({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:se(String),default:"solid"}}),_9=G({name:"ElDivider"}),C9=G({..._9,props:w9,setup(e){const t=e,n=ye("divider"),o=C(()=>n.cssVar({"border-style":t.borderStyle}));return(r,l)=>(S(),x("div",{class:E([i(n).b(),i(n).m(r.direction)]),style:He(i(o)),role:"separator"},[r.$slots.default&&r.direction!=="vertical"?(S(),x("div",{key:0,class:E([i(n).e("text"),i(n).is(r.contentPosition)])},[ve(r.$slots,"default")],2)):oe("v-if",!0)],6))}});var S9=Ne(C9,[["__file","/home/runner/work/element-plus/element-plus/packages/components/divider/src/divider.vue"]]);const M2=it(S9),k9=Me({...T2,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0}}),$9=O2,E9=G({name:"ElDrawer",components:{ElOverlay:_h,ElFocusTrap:bc,ElIcon:ze,Close:vo},inheritAttrs:!1,props:k9,emits:$9,setup(e,{slots:t}){Ro({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},C(()=>!!t.title)),Ro({scope:"el-drawer",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/drawer.html#attributes",type:"Attribute"},C(()=>!!e.customClass));const n=N(),o=N(),r=ye("drawer"),{t:l}=Ct(),s=C(()=>e.direction==="rtl"||e.direction==="ltr"),a=C(()=>qt(e.size));return{...N2(e,n),drawerRef:n,focusStartRef:o,isHorizontal:s,drawerSize:a,ns:r,t:l}}}),T9=["aria-label","aria-labelledby","aria-describedby"],O9=["id"],N9=["aria-label"],M9=["id"];function I9(e,t,n,o,r,l){const s=Qe("close"),a=Qe("el-icon"),u=Qe("el-focus-trap"),c=Qe("el-overlay");return S(),ae(Ha,{to:"body",disabled:!e.appendToBody},[z(Yt,{name:e.ns.b("fade"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave,onBeforeLeave:e.beforeLeave,persisted:""},{default:q(()=>[et(z(c,{mask:e.modal,"overlay-class":e.modalClass,"z-index":e.zIndex,onClick:e.onModalClick},{default:q(()=>[z(u,{loop:"",trapped:e.visible,"focus-trap-el":e.drawerRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:q(()=>[I("div",pt({ref:"drawerRef","aria-modal":"true","aria-label":e.title||void 0,"aria-labelledby":e.title?void 0:e.titleId,"aria-describedby":e.bodyId},e.$attrs,{class:[e.ns.b(),e.direction,e.visible&&"open",e.customClass],style:e.isHorizontal?"width: "+e.drawerSize:"height: "+e.drawerSize,role:"dialog",onClick:t[1]||(t[1]=Ge(()=>{},["stop"]))}),[I("span",{ref:"focusStartRef",class:E(e.ns.e("sr-focus")),tabindex:"-1"},null,2),e.withHeader?(S(),x("header",{key:0,class:E(e.ns.e("header"))},[e.$slots.title?ve(e.$slots,"title",{key:1},()=>[oe(" DEPRECATED SLOT ")]):ve(e.$slots,"header",{key:0,close:e.handleClose,titleId:e.titleId,titleClass:e.ns.e("title")},()=>[e.$slots.title?oe("v-if",!0):(S(),x("span",{key:0,id:e.titleId,role:"heading",class:E(e.ns.e("title"))},ue(e.title),11,O9))]),e.showClose?(S(),x("button",{key:2,"aria-label":e.t("el.drawer.close"),class:E(e.ns.e("close-btn")),type:"button",onClick:t[0]||(t[0]=(...d)=>e.handleClose&&e.handleClose(...d))},[z(a,{class:E(e.ns.e("close"))},{default:q(()=>[z(s)]),_:1},8,["class"])],10,N9)):oe("v-if",!0)],2)):oe("v-if",!0),e.rendered?(S(),x("div",{key:1,id:e.bodyId,class:E(e.ns.e("body"))},[ve(e.$slots,"default")],10,M9)):oe("v-if",!0),e.$slots.footer?(S(),x("div",{key:2,class:E(e.ns.e("footer"))},[ve(e.$slots,"footer")],2)):oe("v-if",!0)],16,T9)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[kt,e.visible]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var P9=Ne(E9,[["render",I9],["__file","/home/runner/work/element-plus/element-plus/packages/components/drawer/src/drawer.vue"]]);const R9=it(P9),A9=G({inheritAttrs:!1});function x9(e,t,n,o,r,l){return ve(e.$slots,"default")}var L9=Ne(A9,[["render",x9],["__file","/home/runner/work/element-plus/element-plus/packages/components/collection/src/collection.vue"]]);const D9=G({name:"ElCollectionItem",inheritAttrs:!1});function B9(e,t,n,o,r,l){return ve(e.$slots,"default")}var F9=Ne(D9,[["render",B9],["__file","/home/runner/work/element-plus/element-plus/packages/components/collection/src/collection-item.vue"]]);const I2="data-el-collection-item",P2=e=>{const t=`El${e}Collection`,n=`${t}Item`,o=Symbol(t),r=Symbol(n),l={...L9,name:t,setup(){const a=N(null),u=new Map;ht(o,{itemMap:u,getItems:()=>{const d=i(a);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${I2}]`));return[...u.values()].sort((v,m)=>f.indexOf(v.ref)-f.indexOf(m.ref))},collectionRef:a})}},s={...F9,name:n,setup(a,{attrs:u}){const c=N(null),d=De(o,void 0);ht(r,{collectionItemRef:c}),tt(()=>{const f=i(c);f&&d.itemMap.set(f,{ref:f,...u})}),Dt(()=>{const f=i(c);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:o,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:l,ElCollectionItem:s}},V9=Me({style:{type:se([String,Array,Object])},currentTabId:{type:se(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:se(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:z9,ElCollectionItem:H9,COLLECTION_INJECTION_KEY:Ch,COLLECTION_ITEM_INJECTION_KEY:K9}=P2("RovingFocusGroup"),Sh=Symbol("elRovingFocusGroup"),R2=Symbol("elRovingFocusGroupItem"),j9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},W9=(e,t)=>{if(t!=="rtl")return e;switch(e){case We.right:return We.left;case We.left:return We.right;default:return e}},U9=(e,t,n)=>{const o=W9(e.key,n);if(!(t==="vertical"&&[We.left,We.right].includes(o))&&!(t==="horizontal"&&[We.up,We.down].includes(o)))return j9[o]},q9=(e,t)=>e.map((n,o)=>e[(o+t)%e.length]),kh=e=>{const{activeElement:t}=document;for(const n of e)if(n===t||(n.focus(),t!==document.activeElement))return},Ug="currentTabIdChange",qg="rovingFocusGroup.entryFocus",Y9={bubbles:!1,cancelable:!0},G9=G({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:V9,emits:[Ug,"entryFocus"],setup(e,{emit:t}){var n;const o=N((n=e.currentTabId||e.defaultCurrentTabId)!=null?n:null),r=N(!1),l=N(!1),s=N(null),{getItems:a}=De(Ch,void 0),u=C(()=>[{outline:"none"},e.style]),c=h=>{t(Ug,h)},d=()=>{r.value=!0},f=Kt(h=>{var g;(g=e.onMousedown)==null||g.call(e,h)},()=>{l.value=!0}),p=Kt(h=>{var g;(g=e.onFocus)==null||g.call(e,h)},h=>{const g=!i(l),{target:y,currentTarget:w}=h;if(y===w&&g&&!i(r)){const b=new Event(qg,Y9);if(w==null||w.dispatchEvent(b),!b.defaultPrevented){const _=a().filter(P=>P.focusable),k=_.find(P=>P.active),$=_.find(P=>P.id===i(o)),O=[k,$,..._].filter(Boolean).map(P=>P.ref);kh(O)}}l.value=!1}),v=Kt(h=>{var g;(g=e.onBlur)==null||g.call(e,h)},()=>{r.value=!1}),m=(...h)=>{t("entryFocus",...h)};ht(Sh,{currentTabbedId:bs(o),loop:Lt(e,"loop"),tabIndex:C(()=>i(r)?-1:0),rovingFocusGroupRef:s,rovingFocusGroupRootStyle:u,orientation:Lt(e,"orientation"),dir:Lt(e,"dir"),onItemFocus:c,onItemShiftTab:d,onBlur:v,onFocus:p,onMousedown:f}),me(()=>e.currentTabId,h=>{o.value=h??null}),Vt(s,qg,m)}});function X9(e,t,n,o,r,l){return ve(e.$slots,"default")}var J9=Ne(G9,[["render",X9],["__file","/home/runner/work/element-plus/element-plus/packages/components/roving-focus-group/src/roving-focus-group-impl.vue"]]);const Z9=G({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:z9,ElRovingFocusGroupImpl:J9}});function Q9(e,t,n,o,r,l){const s=Qe("el-roving-focus-group-impl"),a=Qe("el-focus-group-collection");return S(),ae(a,null,{default:q(()=>[z(s,io(Xu(e.$attrs)),{default:q(()=>[ve(e.$slots,"default")]),_:3},16)]),_:3})}var eK=Ne(Z9,[["render",Q9],["__file","/home/runner/work/element-plus/element-plus/packages/components/roving-focus-group/src/roving-focus-group.vue"]]);const tK=G({components:{ElRovingFocusCollectionItem:H9},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:n,loop:o,onItemFocus:r,onItemShiftTab:l}=De(Sh,void 0),{getItems:s}=De(Ch,void 0),a=no(),u=N(null),c=Kt(v=>{t("mousedown",v)},v=>{e.focusable?r(i(a)):v.preventDefault()}),d=Kt(v=>{t("focus",v)},()=>{r(i(a))}),f=Kt(v=>{t("keydown",v)},v=>{const{key:m,shiftKey:h,target:g,currentTarget:y}=v;if(m===We.tab&&h){l();return}if(g!==y)return;const w=U9(v);if(w){v.preventDefault();let _=s().filter(k=>k.focusable).map(k=>k.ref);switch(w){case"last":{_.reverse();break}case"prev":case"next":{w==="prev"&&_.reverse();const k=_.indexOf(y);_=o.value?q9(_,k+1):_.slice(k+1);break}}Ke(()=>{kh(_)})}}),p=C(()=>n.value===i(a));return ht(R2,{rovingFocusGroupItemRef:u,tabIndex:C(()=>i(p)?0:-1),handleMousedown:c,handleFocus:d,handleKeydown:f}),{id:a,handleKeydown:f,handleFocus:d,handleMousedown:c}}});function nK(e,t,n,o,r,l){const s=Qe("el-roving-focus-collection-item");return S(),ae(s,{id:e.id,focusable:e.focusable,active:e.active},{default:q(()=>[ve(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var oK=Ne(tK,[["render",nK],["__file","/home/runner/work/element-plus/element-plus/packages/components/roving-focus-group/src/roving-focus-item.vue"]]);const Zi=Me({trigger:Ea.trigger,effect:{...sn.effect,default:"light"},type:{type:se(String)},placement:{type:se(String),default:"bottom"},popperOptions:{type:se(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:se([Number,String]),default:0},maxHeight:{type:se([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:se(Object)},teleported:sn.teleported}),A2=Me({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Rt}}),rK=Me({onKeydown:{type:se(Function)}}),lK=[We.down,We.pageDown,We.home],x2=[We.up,We.pageUp,We.end],sK=[...lK,...x2],{ElCollection:aK,ElCollectionItem:iK,COLLECTION_INJECTION_KEY:uK,COLLECTION_ITEM_INJECTION_KEY:cK}=P2("Dropdown"),Cc=Symbol("elDropdown"),{ButtonGroup:dK}=Zt,fK=G({name:"ElDropdown",components:{ElButton:Zt,ElButtonGroup:dK,ElScrollbar:or,ElDropdownCollection:aK,ElTooltip:En,ElRovingFocusGroup:eK,ElOnlyChild:iw,ElIcon:ze,ArrowDown:xr},props:Zi,emits:["visible-change","click","command"],setup(e,{emit:t}){const n=ut(),o=ye("dropdown"),{t:r}=Ct(),l=N(),s=N(),a=N(null),u=N(null),c=N(null),d=N(null),f=N(!1),p=[We.enter,We.space,We.down],v=C(()=>({maxHeight:qt(e.maxHeight)})),m=C(()=>[o.m(_.value)]),h=no().value,g=C(()=>e.id||h);me([l,Lt(e,"trigger")],([F,T],[L])=>{var R,U,ne;const j=Ve(T)?T:[T];(R=L==null?void 0:L.$el)!=null&&R.removeEventListener&&L.$el.removeEventListener("pointerenter",$),(U=F==null?void 0:F.$el)!=null&&U.removeEventListener&&F.$el.removeEventListener("pointerenter",$),(ne=F==null?void 0:F.$el)!=null&&ne.addEventListener&&j.includes("hover")&&F.$el.addEventListener("pointerenter",$)},{immediate:!0}),Dt(()=>{var F,T;(T=(F=l.value)==null?void 0:F.$el)!=null&&T.removeEventListener&&l.value.$el.removeEventListener("pointerenter",$)});function y(){w()}function w(){var F;(F=a.value)==null||F.onClose()}function b(){var F;(F=a.value)==null||F.onOpen()}const _=Jt();function k(...F){t("command",...F)}function $(){var F,T;(T=(F=l.value)==null?void 0:F.$el)==null||T.focus()}function M(){}function O(){const F=i(u);F==null||F.focus(),d.value=null}function P(F){d.value=F}function A(F){f.value||(F.preventDefault(),F.stopImmediatePropagation())}function V(){t("visible-change",!0)}function B(F){(F==null?void 0:F.type)==="keydown"&&u.value.focus()}function D(){t("visible-change",!1)}return ht(Cc,{contentRef:u,role:C(()=>e.role),triggerId:g,isUsingKeyboard:f,onItemEnter:M,onItemLeave:O}),ht("elDropdown",{instance:n,dropdownSize:_,handleClick:y,commandHandler:k,trigger:Lt(e,"trigger"),hideOnClick:Lt(e,"hideOnClick")}),{t:r,ns:o,scrollbar:c,wrapStyle:v,dropdownTriggerKls:m,dropdownSize:_,triggerId:g,triggerKeys:p,currentTabId:d,handleCurrentTabIdChange:P,handlerMainButtonClick:F=>{t("click",F)},handleEntryFocus:A,handleClose:w,handleOpen:b,handleBeforeShowTooltip:V,handleShowTooltip:B,handleBeforeHideTooltip:D,onFocusAfterTrapped:F=>{var T,L;F.preventDefault(),(L=(T=u.value)==null?void 0:T.focus)==null||L.call(T,{preventScroll:!0})},popperRef:a,contentRef:u,triggeringElementRef:l,referenceElementRef:s}}});function pK(e,t,n,o,r,l){var s;const a=Qe("el-dropdown-collection"),u=Qe("el-roving-focus-group"),c=Qe("el-scrollbar"),d=Qe("el-only-child"),f=Qe("el-tooltip"),p=Qe("el-button"),v=Qe("arrow-down"),m=Qe("el-icon"),h=Qe("el-button-group");return S(),x("div",{class:E([e.ns.b(),e.ns.is("disabled",e.disabled)])},[z(f,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":e.trigger==="hover"?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":(s=e.referenceElementRef)==null?void 0:s.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":e.trigger==="hover"?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:"",onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},Xo({content:q(()=>[z(c,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:q(()=>[z(u,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:q(()=>[z(a,null,{default:q(()=>[ve(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:q(()=>[z(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:q(()=>[ve(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(S(),ae(h,{key:0},{default:q(()=>[z(p,pt({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:q(()=>[ve(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),z(p,pt({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:q(()=>[z(m,{class:E(e.ns.e("icon"))},{default:q(()=>[z(v)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):oe("v-if",!0)],2)}var hK=Ne(fK,[["render",pK],["__file","/home/runner/work/element-plus/element-plus/packages/components/dropdown/src/dropdown.vue"]]);const vK=G({name:"DropdownItemImpl",components:{ElIcon:ze},props:A2,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const n=ye("dropdown"),{role:o}=De(Cc,void 0),{collectionItemRef:r}=De(cK,void 0),{collectionItemRef:l}=De(K9,void 0),{rovingFocusGroupItemRef:s,tabIndex:a,handleFocus:u,handleKeydown:c,handleMousedown:d}=De(R2,void 0),f=ic(r,l,s),p=C(()=>o.value==="menu"?"menuitem":o.value==="navigation"?"link":"button"),v=Kt(m=>{const{code:h}=m;if(h===We.enter||h===We.space)return m.preventDefault(),m.stopImmediatePropagation(),t("clickimpl",m),!0},c);return{ns:n,itemRef:f,dataset:{[I2]:""},role:p,tabIndex:a,handleFocus:u,handleKeydown:v,handleMousedown:d}}}),mK=["aria-disabled","tabindex","role"];function gK(e,t,n,o,r,l){const s=Qe("el-icon");return S(),x(xe,null,[e.divided?(S(),x("li",pt({key:0,role:"separator",class:e.ns.bem("menu","item","divided")},e.$attrs),null,16)):oe("v-if",!0),I("li",pt({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t[0]||(t[0]=a=>e.$emit("clickimpl",a)),onFocus:t[1]||(t[1]=(...a)=>e.handleFocus&&e.handleFocus(...a)),onKeydown:t[2]||(t[2]=Ge((...a)=>e.handleKeydown&&e.handleKeydown(...a),["self"])),onMousedown:t[3]||(t[3]=(...a)=>e.handleMousedown&&e.handleMousedown(...a)),onPointermove:t[4]||(t[4]=a=>e.$emit("pointermove",a)),onPointerleave:t[5]||(t[5]=a=>e.$emit("pointerleave",a))}),[e.icon?(S(),ae(s,{key:0},{default:q(()=>[(S(),ae(vt(e.icon)))]),_:1})):oe("v-if",!0),ve(e.$slots,"default")],16,mK)],64)}var yK=Ne(vK,[["render",gK],["__file","/home/runner/work/element-plus/element-plus/packages/components/dropdown/src/dropdown-item-impl.vue"]]);const L2=()=>{const e=De("elDropdown",{}),t=C(()=>e==null?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:t}},bK=G({name:"ElDropdownItem",components:{ElDropdownCollectionItem:iK,ElRovingFocusItem:oK,ElDropdownItemImpl:yK},inheritAttrs:!1,props:A2,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:n}){const{elDropdown:o}=L2(),r=ut(),l=N(null),s=C(()=>{var v,m;return(m=(v=i(l))==null?void 0:v.textContent)!=null?m:""}),{onItemEnter:a,onItemLeave:u}=De(Cc,void 0),c=Kt(v=>(t("pointermove",v),v.defaultPrevented),Uv(v=>{if(e.disabled){u(v);return}const m=v.currentTarget;m===document.activeElement||m.contains(document.activeElement)||(a(v),v.defaultPrevented||m==null||m.focus())})),d=Kt(v=>(t("pointerleave",v),v.defaultPrevented),Uv(v=>{u(v)})),f=Kt(v=>{if(!e.disabled)return t("click",v),v.type!=="keydown"&&v.defaultPrevented},v=>{var m,h,g;if(e.disabled){v.stopImmediatePropagation();return}(m=o==null?void 0:o.hideOnClick)!=null&&m.value&&((h=o.handleClick)==null||h.call(o)),(g=o.commandHandler)==null||g.call(o,e.command,r,v)}),p=C(()=>({...e,...n}));return{handleClick:f,handlePointerMove:c,handlePointerLeave:d,textContent:s,propsAndAttrs:p}}});function wK(e,t,n,o,r,l){var s;const a=Qe("el-dropdown-item-impl"),u=Qe("el-roving-focus-item"),c=Qe("el-dropdown-collection-item");return S(),ae(c,{disabled:e.disabled,"text-value":(s=e.textValue)!=null?s:e.textContent},{default:q(()=>[z(u,{focusable:!e.disabled},{default:q(()=>[z(a,pt(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:q(()=>[ve(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var D2=Ne(bK,[["render",wK],["__file","/home/runner/work/element-plus/element-plus/packages/components/dropdown/src/dropdown-item.vue"]]);const _K=G({name:"ElDropdownMenu",props:rK,setup(e){const t=ye("dropdown"),{_elDropdownSize:n}=L2(),o=n.value,{focusTrapRef:r,onKeydown:l}=De(dh,void 0),{contentRef:s,role:a,triggerId:u}=De(Cc,void 0),{collectionRef:c,getItems:d}=De(uK,void 0),{rovingFocusGroupRef:f,rovingFocusGroupRootStyle:p,tabIndex:v,onBlur:m,onFocus:h,onMousedown:g}=De(Sh,void 0),{collectionRef:y}=De(Ch,void 0),w=C(()=>[t.b("menu"),t.bm("menu",o==null?void 0:o.value)]),b=ic(s,c,r,f,y),_=Kt($=>{var M;(M=e.onKeydown)==null||M.call(e,$)},$=>{const{currentTarget:M,code:O,target:P}=$;if(M.contains(P),We.tab===O&&$.stopImmediatePropagation(),$.preventDefault(),P!==i(s)||!sK.includes(O))return;const V=d().filter(B=>!B.disabled).map(B=>B.ref);x2.includes(O)&&V.reverse(),kh(V)});return{size:o,rovingFocusGroupRootStyle:p,tabIndex:v,dropdownKls:w,role:a,triggerId:u,dropdownListWrapperRef:b,handleKeydown:$=>{_($),l($)},onBlur:m,onFocus:h,onMousedown:g}}}),CK=["role","aria-labelledby"];function SK(e,t,n,o,r,l){return S(),x("ul",{ref:e.dropdownListWrapperRef,class:E(e.dropdownKls),style:He(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:t[0]||(t[0]=(...s)=>e.onBlur&&e.onBlur(...s)),onFocus:t[1]||(t[1]=(...s)=>e.onFocus&&e.onFocus(...s)),onKeydown:t[2]||(t[2]=Ge((...s)=>e.handleKeydown&&e.handleKeydown(...s),["self"])),onMousedown:t[3]||(t[3]=Ge((...s)=>e.onMousedown&&e.onMousedown(...s),["self"]))},[ve(e.$slots,"default")],46,CK)}var B2=Ne(_K,[["render",SK],["__file","/home/runner/work/element-plus/element-plus/packages/components/dropdown/src/dropdown-menu.vue"]]);const kK=it(hK,{DropdownItem:D2,DropdownMenu:B2}),$K=jt(D2),EK=jt(B2),TK={viewBox:"0 0 79 86",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},OK=["id"],NK=["stop-color"],MK=["stop-color"],IK=["id"],PK=["stop-color"],RK=["stop-color"],AK=["id"],xK={id:"Illustrations",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},LK={id:"B-type",transform:"translate(-1268.000000, -535.000000)"},DK={id:"Group-2",transform:"translate(1268.000000, 535.000000)"},BK=["fill"],FK=["fill"],VK={id:"Group-Copy",transform:"translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"},zK=["fill"],HK=["fill"],KK=["fill"],jK=["fill"],WK=["fill"],UK={id:"Rectangle-Copy-17",transform:"translate(53.000000, 45.000000)"},qK=["fill","xlink:href"],YK=["fill","mask"],GK=["fill"],XK=G({name:"ImgEmpty"}),JK=G({...XK,setup(e){const t=ye("empty"),n=no();return(o,r)=>(S(),x("svg",TK,[I("defs",null,[I("linearGradient",{id:`linearGradient-1-${i(n)}`,x1:"38.8503086%",y1:"0%",x2:"61.1496914%",y2:"100%"},[I("stop",{"stop-color":`var(${i(t).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,NK),I("stop",{"stop-color":`var(${i(t).cssVarBlockName("fill-color-4")})`,offset:"100%"},null,8,MK)],8,OK),I("linearGradient",{id:`linearGradient-2-${i(n)}`,x1:"0%",y1:"9.5%",x2:"100%",y2:"90.5%"},[I("stop",{"stop-color":`var(${i(t).cssVarBlockName("fill-color-1")})`,offset:"0%"},null,8,PK),I("stop",{"stop-color":`var(${i(t).cssVarBlockName("fill-color-6")})`,offset:"100%"},null,8,RK)],8,IK),I("rect",{id:`path-3-${i(n)}`,x:"0",y:"0",width:"17",height:"36"},null,8,AK)]),I("g",xK,[I("g",LK,[I("g",DK,[I("path",{id:"Oval-Copy-2",d:"M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",fill:`var(${i(t).cssVarBlockName("fill-color-3")})`},null,8,BK),I("polygon",{id:"Rectangle-Copy-14",fill:`var(${i(t).cssVarBlockName("fill-color-7")})`,transform:"translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",points:"13 58 53 58 42 45 2 45"},null,8,FK),I("g",VK,[I("polygon",{id:"Rectangle-Copy-10",fill:`var(${i(t).cssVarBlockName("fill-color-7")})`,transform:"translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",points:"2.84078316e-14 3 18 3 23 7 5 7"},null,8,zK),I("polygon",{id:"Rectangle-Copy-11",fill:`var(${i(t).cssVarBlockName("fill-color-5")})`,points:"-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"},null,8,HK),I("rect",{id:"Rectangle-Copy-12",fill:`url(#linearGradient-1-${i(n)})`,transform:"translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",x:"38",y:"7",width:"17",height:"36"},null,8,KK),I("polygon",{id:"Rectangle-Copy-13",fill:`var(${i(t).cssVarBlockName("fill-color-2")})`,transform:"translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",points:"24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"},null,8,jK)]),I("rect",{id:"Rectangle-Copy-15",fill:`url(#linearGradient-2-${i(n)})`,x:"13",y:"45",width:"40",height:"36"},null,8,WK),I("g",UK,[I("use",{id:"Mask",fill:`var(${i(t).cssVarBlockName("fill-color-8")})`,transform:"translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ","xlink:href":`#path-3-${i(n)}`},null,8,qK),I("polygon",{id:"Rectangle-Copy",fill:`var(${i(t).cssVarBlockName("fill-color-9")})`,mask:`url(#mask-4-${i(n)})`,transform:"translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",points:"7 0 24 0 20 18 7 16.5"},null,8,YK)]),I("polygon",{id:"Rectangle-Copy-18",fill:`var(${i(t).cssVarBlockName("fill-color-2")})`,transform:"translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",points:"62 45 79 45 70 58 53 58"},null,8,GK)])])])]))}});var ZK=Ne(JK,[["__file","/home/runner/work/element-plus/element-plus/packages/components/empty/src/img-empty.vue"]]);const QK=Me({image:{type:String,default:""},imageSize:Number,description:{type:String,default:""}}),e7=["src"],t7={key:1},n7=G({name:"ElEmpty"}),o7=G({...n7,props:QK,setup(e){const t=e,{t:n}=Ct(),o=ye("empty"),r=C(()=>t.description||n("el.table.emptyText")),l=C(()=>({width:qt(t.imageSize)}));return(s,a)=>(S(),x("div",{class:E(i(o).b())},[I("div",{class:E(i(o).e("image")),style:He(i(l))},[s.image?(S(),x("img",{key:0,src:s.image,ondragstart:"return false"},null,8,e7)):ve(s.$slots,"image",{key:1},()=>[z(ZK)])],6),I("div",{class:E(i(o).e("description"))},[s.$slots.description?ve(s.$slots,"description",{key:0}):(S(),x("p",t7,ue(i(r)),1))],2),s.$slots.default?(S(),x("div",{key:0,class:E(i(o).e("bottom"))},[ve(s.$slots,"default")],2)):oe("v-if",!0)],2))}});var r7=Ne(o7,[["__file","/home/runner/work/element-plus/element-plus/packages/components/empty/src/empty.vue"]]);const Sc=it(r7),l7=Me({urlList:{type:se(Array),default:()=>Ft([])},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!1},teleported:{type:Boolean,default:!1},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2}}),s7={close:()=>!0,switch:e=>Xe(e)},a7=["src"],i7=G({name:"ElImageViewer"}),u7=G({...i7,props:l7,emits:s7,setup(e,{expose:t,emit:n}){const o=e,r={CONTAIN:{name:"contain",icon:sl(vP)},ORIGINAL:{name:"original",icon:sl(zR)}},{t:l}=Ct(),s=ye("image-viewer"),{nextZIndex:a}=Sl(),u=N(),c=N([]),d=nS(),f=N(!0),p=N(o.initialIndex),v=Pt(r.CONTAIN),m=N({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),h=C(()=>{const{urlList:T}=o;return T.length<=1}),g=C(()=>p.value===0),y=C(()=>p.value===o.urlList.length-1),w=C(()=>o.urlList[p.value]),b=C(()=>{const{scale:T,deg:L,offsetX:R,offsetY:U,enableTransition:ne}=m.value;let j=R/T,Q=U/T;switch(L%360){case 90:case-270:[j,Q]=[Q,-j];break;case 180:case-180:[j,Q]=[-j,-Q];break;case 270:case-90:[j,Q]=[-Q,j];break}const he={transform:`scale(${T}) rotate(${L}deg) translate(${j}px, ${Q}px)`,transition:ne?"transform .3s":""};return v.value.name===r.CONTAIN.name&&(he.maxWidth=he.maxHeight="100%"),he}),_=C(()=>Xe(o.zIndex)?o.zIndex:a());function k(){M(),n("close")}function $(){const T=il(R=>{switch(R.code){case We.esc:o.closeOnPressEscape&&k();break;case We.space:B();break;case We.left:H();break;case We.up:F("zoomIn");break;case We.right:W();break;case We.down:F("zoomOut");break}}),L=il(R=>{const U=R.deltaY||R.deltaX;F(U<0?"zoomIn":"zoomOut",{zoomRate:o.zoomRate,enableTransition:!1})});d.run(()=>{Vt(document,"keydown",T),Vt(document,"wheel",L)})}function M(){d.stop()}function O(){f.value=!1}function P(T){f.value=!1,T.target.alt=l("el.image.error")}function A(T){if(f.value||T.button!==0||!u.value)return;m.value.enableTransition=!1;const{offsetX:L,offsetY:R}=m.value,U=T.pageX,ne=T.pageY,j=il(he=>{m.value={...m.value,offsetX:L+he.pageX-U,offsetY:R+he.pageY-ne}}),Q=Vt(document,"mousemove",j);Vt(document,"mouseup",()=>{Q()}),T.preventDefault()}function V(){m.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function B(){if(f.value)return;const T=ba(r),L=Object.values(r),R=v.value.name,ne=(L.findIndex(j=>j.name===R)+1)%T.length;v.value=r[T[ne]],V()}function D(T){const L=o.urlList.length;p.value=(T+L)%L}function H(){g.value&&!o.infinite||D(p.value-1)}function W(){y.value&&!o.infinite||D(p.value+1)}function F(T,L={}){if(f.value)return;const{zoomRate:R,rotateDeg:U,enableTransition:ne}={zoomRate:o.zoomRate,rotateDeg:90,enableTransition:!0,...L};switch(T){case"zoomOut":m.value.scale>.2&&(m.value.scale=Number.parseFloat((m.value.scale/R).toFixed(3)));break;case"zoomIn":m.value.scale<7&&(m.value.scale=Number.parseFloat((m.value.scale*R).toFixed(3)));break;case"clockwise":m.value.deg+=U;break;case"anticlockwise":m.value.deg-=U;break}m.value.enableTransition=ne}return me(w,()=>{Ke(()=>{const T=c.value[0];T!=null&&T.complete||(f.value=!0)})}),me(p,T=>{V(),n("switch",T)}),tt(()=>{var T,L;$(),(L=(T=u.value)==null?void 0:T.focus)==null||L.call(T)}),t({setActiveItem:D}),(T,L)=>(S(),ae(Ha,{to:"body",disabled:!T.teleported},[z(Yt,{name:"viewer-fade",appear:""},{default:q(()=>[I("div",{ref_key:"wrapper",ref:u,tabindex:-1,class:E(i(s).e("wrapper")),style:He({zIndex:i(_)})},[I("div",{class:E(i(s).e("mask")),onClick:L[0]||(L[0]=Ge(R=>T.hideOnClickModal&&k(),["self"]))},null,2),oe(" CLOSE "),I("span",{class:E([i(s).e("btn"),i(s).e("close")]),onClick:k},[z(i(ze),null,{default:q(()=>[z(i(vo))]),_:1})],2),oe(" ARROW "),i(h)?oe("v-if",!0):(S(),x(xe,{key:0},[I("span",{class:E([i(s).e("btn"),i(s).e("prev"),i(s).is("disabled",!T.infinite&&i(g))]),onClick:H},[z(i(ze),null,{default:q(()=>[z(i(Tr))]),_:1})],2),I("span",{class:E([i(s).e("btn"),i(s).e("next"),i(s).is("disabled",!T.infinite&&i(y))]),onClick:W},[z(i(ze),null,{default:q(()=>[z(i(_n))]),_:1})],2)],64)),oe(" ACTIONS "),I("div",{class:E([i(s).e("btn"),i(s).e("actions")])},[I("div",{class:E(i(s).e("actions__inner"))},[z(i(ze),{onClick:L[1]||(L[1]=R=>F("zoomOut"))},{default:q(()=>[z(i(YA))]),_:1}),z(i(ze),{onClick:L[2]||(L[2]=R=>F("zoomIn"))},{default:q(()=>[z(i(d1))]),_:1}),I("i",{class:E(i(s).e("actions__divider"))},null,2),z(i(ze),{onClick:B},{default:q(()=>[(S(),ae(vt(i(v).icon)))]),_:1}),I("i",{class:E(i(s).e("actions__divider"))},null,2),z(i(ze),{onClick:L[3]||(L[3]=R=>F("anticlockwise"))},{default:q(()=>[z(i(NR))]),_:1}),z(i(ze),{onClick:L[4]||(L[4]=R=>F("clockwise"))},{default:q(()=>[z(i(xR))]),_:1})],2)],2),oe(" CANVAS "),I("div",{class:E(i(s).e("canvas"))},[(S(!0),x(xe,null,lt(T.urlList,(R,U)=>et((S(),x("img",{ref_for:!0,ref:ne=>c.value[U]=ne,key:R,src:R,style:He(i(b)),class:E(i(s).e("img")),onLoad:O,onError:P,onMousedown:A},null,46,a7)),[[kt,U===p.value]])),128))],2),ve(T.$slots,"default")],6)]),_:3})],8,["disabled"]))}});var c7=Ne(u7,[["__file","/home/runner/work/element-plus/element-plus/packages/components/image-viewer/src/image-viewer.vue"]]);const F2=it(c7),d7=Me({hideOnClickModal:{type:Boolean,default:!1},src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:{type:Boolean,default:!1},scrollContainer:{type:se([String,Object])},previewSrcList:{type:se(Array),default:()=>Ft([])},previewTeleported:{type:Boolean,default:!1},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2}}),f7={load:e=>e instanceof Event,error:e=>e instanceof Event,switch:e=>Xe(e),close:()=>!0,show:()=>!0},p7=["src","loading"],h7={key:0},v7=G({name:"ElImage",inheritAttrs:!1}),m7=G({...v7,props:d7,emits:f7,setup(e,{emit:t}){const n=e;let o="";const{t:r}=Ct(),l=ye("image"),s=_s(),a=Yp(),u=N(),c=N(!1),d=N(!0),f=N(!1),p=N(),v=N(),m=bt&&"loading"in HTMLImageElement.prototype;let h,g;const y=C(()=>s.style),w=C(()=>{const{fit:T}=n;return bt&&T?{objectFit:T}:{}}),b=C(()=>{const{previewSrcList:T}=n;return Array.isArray(T)&&T.length>0}),_=C(()=>{const{previewSrcList:T,initialIndex:L}=n;let R=L;return L>T.length-1&&(R=0),R}),k=C(()=>n.loading==="eager"?!1:!m&&n.loading==="lazy"||n.lazy),$=()=>{bt&&(d.value=!0,c.value=!1,u.value=n.src)};function M(T){d.value=!1,c.value=!1,t("load",T)}function O(T){d.value=!1,c.value=!0,t("error",T)}function P(){U$(p.value,v.value)&&($(),B())}const A=bb(P,200);async function V(){var T;if(!bt)return;await Ke();const{scrollContainer:L}=n;ho(L)?v.value=L:Ze(L)&&L!==""?v.value=(T=document.querySelector(L))!=null?T:void 0:p.value&&(v.value=Kp(p.value)),v.value&&(h=Vt(v,"scroll",A),setTimeout(()=>P(),100))}function B(){!bt||!v.value||!A||(h==null||h(),v.value=void 0)}function D(T){if(T.ctrlKey){if(T.deltaY<0)return T.preventDefault(),!1;if(T.deltaY>0)return T.preventDefault(),!1}}function H(){b.value&&(g=Vt("wheel",D,{passive:!1}),o=document.body.style.overflow,document.body.style.overflow="hidden",f.value=!0,t("show"))}function W(){g==null||g(),document.body.style.overflow=o,f.value=!1,t("close")}function F(T){t("switch",T)}return me(()=>n.src,()=>{k.value?(d.value=!0,c.value=!1,B(),V()):$()}),tt(()=>{k.value?V():$()}),(T,L)=>(S(),x("div",{ref_key:"container",ref:p,class:E([i(l).b(),T.$attrs.class]),style:He(i(y))},[u.value!==void 0&&!c.value?(S(),x("img",pt({key:0},i(a),{src:u.value,loading:T.loading,style:i(w),class:[i(l).e("inner"),i(b)&&i(l).e("preview"),d.value&&i(l).is("loading")],onClick:H,onLoad:M,onError:O}),null,16,p7)):oe("v-if",!0),d.value||c.value?(S(),x("div",{key:1,class:E(i(l).e("wrapper"))},[d.value?ve(T.$slots,"placeholder",{key:0},()=>[I("div",{class:E(i(l).e("placeholder"))},null,2)]):c.value?ve(T.$slots,"error",{key:1},()=>[I("div",{class:E(i(l).e("error"))},ue(i(r)("el.image.error")),3)]):oe("v-if",!0)],2)):oe("v-if",!0),i(b)?(S(),x(xe,{key:2},[f.value?(S(),ae(i(F2),{key:0,"z-index":T.zIndex,"initial-index":i(_),infinite:T.infinite,"zoom-rate":T.zoomRate,"url-list":T.previewSrcList,"hide-on-click-modal":T.hideOnClickModal,teleported:T.previewTeleported,"close-on-press-escape":T.closeOnPressEscape,onClose:W,onSwitch:F},{default:q(()=>[T.$slots.viewer?(S(),x("div",h7,[ve(T.$slots,"viewer")])):oe("v-if",!0)]),_:3},8,["z-index","initial-index","infinite","zoom-rate","url-list","hide-on-click-modal","teleported","close-on-press-escape"])):oe("v-if",!0)],64)):oe("v-if",!0)],6))}});var g7=Ne(m7,[["__file","/home/runner/work/element-plus/element-plus/packages/components/image/src/image.vue"]]);const y7=it(g7),b7=Me({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:hn,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:e=>e===null||Xe(e)||["min","max"].includes(e),default:null},name:String,label:String,placeholder:String,precision:{type:Number,validator:e=>e>=0&&e===Number.parseInt(`${e}`,10)},validateEvent:{type:Boolean,default:!0}}),w7={[At]:(e,t)=>t!==e,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,[Cn]:e=>Xe(e)||nn(e),[dt]:e=>Xe(e)||nn(e)},_7=["aria-label","onKeydown"],C7=["aria-label","onKeydown"],S7=G({name:"ElInputNumber"}),k7=G({...S7,props:b7,emits:w7,setup(e,{expose:t,emit:n}){const o=e,{t:r}=Ct(),l=ye("input-number"),s=N(),a=yt({currentValue:o.modelValue,userInput:null}),{formItem:u}=Tn(),c=C(()=>Xe(o.modelValue)&&o.modelValue<=o.min),d=C(()=>Xe(o.modelValue)&&o.modelValue>=o.max),f=C(()=>{const D=y(o.step);return an(o.precision)?Math.max(y(o.modelValue),D):(D>o.precision,o.precision)}),p=C(()=>o.controls&&o.controlsPosition==="right"),v=Jt(),m=xn(),h=C(()=>{if(a.userInput!==null)return a.userInput;let D=a.currentValue;if(nn(D))return"";if(Xe(D)){if(Number.isNaN(D))return"";an(o.precision)||(D=D.toFixed(o.precision))}return D}),g=(D,H)=>{if(an(H)&&(H=f.value),H===0)return Math.round(D);let W=String(D);const F=W.indexOf(".");if(F===-1||!W.replace(".","").split("")[F+H])return D;const R=W.length;return W.charAt(R-1)==="5"&&(W=`${W.slice(0,Math.max(0,R-1))}6`),Number.parseFloat(Number(W).toFixed(H))},y=D=>{if(nn(D))return 0;const H=D.toString(),W=H.indexOf(".");let F=0;return W!==-1&&(F=H.length-W-1),F},w=(D,H=1)=>Xe(D)?g(D+o.step*H):a.currentValue,b=()=>{if(o.readonly||m.value||d.value)return;const D=Number(h.value)||0,H=w(D);$(H),n(Cn,a.currentValue)},_=()=>{if(o.readonly||m.value||c.value)return;const D=Number(h.value)||0,H=w(D,-1);$(H),n(Cn,a.currentValue)},k=(D,H)=>{const{max:W,min:F,step:T,precision:L,stepStrictly:R,valueOnClear:U}=o;let ne=Number(D);if(nn(D)||Number.isNaN(ne))return null;if(D===""){if(U===null)return null;ne=Ze(U)?{min:F,max:W}[U]:U}return R&&(ne=g(Math.round(ne/T)*T,L)),an(L)||(ne=g(ne,L)),(ne>W||neW?W:F,H&&n(dt,ne)),ne},$=(D,H=!0)=>{var W;const F=a.currentValue,T=k(D);if(!H){n(dt,T);return}F!==T&&(a.userInput=null,n(dt,T),n(At,T,F),o.validateEvent&&((W=u==null?void 0:u.validate)==null||W.call(u,"change").catch(L=>void 0)),a.currentValue=T)},M=D=>{a.userInput=D;const H=D===""?null:Number(D);n(Cn,H),$(H,!1)},O=D=>{const H=D!==""?Number(D):"";(Xe(H)&&!Number.isNaN(H)||D==="")&&$(H),a.userInput=null},P=()=>{var D,H;(H=(D=s.value)==null?void 0:D.focus)==null||H.call(D)},A=()=>{var D,H;(H=(D=s.value)==null?void 0:D.blur)==null||H.call(D)},V=D=>{n("focus",D)},B=D=>{var H;n("blur",D),o.validateEvent&&((H=u==null?void 0:u.validate)==null||H.call(u,"blur").catch(W=>void 0))};return me(()=>o.modelValue,D=>{const H=k(a.userInput),W=k(D,!0);!Xe(H)&&(!H||H!==W)&&(a.currentValue=W,a.userInput=null)},{immediate:!0}),tt(()=>{var D;const{min:H,max:W,modelValue:F}=o,T=(D=s.value)==null?void 0:D.input;if(T.setAttribute("role","spinbutton"),Number.isFinite(W)?T.setAttribute("aria-valuemax",String(W)):T.removeAttribute("aria-valuemax"),Number.isFinite(H)?T.setAttribute("aria-valuemin",String(H)):T.removeAttribute("aria-valuemin"),T.setAttribute("aria-valuenow",String(a.currentValue)),T.setAttribute("aria-disabled",String(m.value)),!Xe(F)&&F!=null){let L=Number(F);Number.isNaN(L)&&(L=null),n(dt,L)}}),er(()=>{var D;const H=(D=s.value)==null?void 0:D.input;H==null||H.setAttribute("aria-valuenow",`${a.currentValue}`)}),t({focus:P,blur:A}),(D,H)=>(S(),x("div",{class:E([i(l).b(),i(l).m(i(v)),i(l).is("disabled",i(m)),i(l).is("without-controls",!D.controls),i(l).is("controls-right",i(p))]),onDragstart:H[1]||(H[1]=Ge(()=>{},["prevent"]))},[D.controls?et((S(),x("span",{key:0,role:"button","aria-label":i(r)("el.inputNumber.decrease"),class:E([i(l).e("decrease"),i(l).is("disabled",i(c))]),onKeydown:wt(_,["enter"])},[z(i(ze),null,{default:q(()=>[i(p)?(S(),ae(i(xr),{key:0})):(S(),ae(i(BP),{key:1}))]),_:1})],42,_7)),[[i(Eu),_]]):oe("v-if",!0),D.controls?et((S(),x("span",{key:1,role:"button","aria-label":i(r)("el.inputNumber.increase"),class:E([i(l).e("increase"),i(l).is("disabled",i(d))]),onKeydown:wt(b,["enter"])},[z(i(ze),null,{default:q(()=>[i(p)?(S(),ae(i(Xa),{key:0})):(S(),ae(i(i1),{key:1}))]),_:1})],42,C7)),[[i(Eu),b]]):oe("v-if",!0),z(i(mn),{id:D.id,ref_key:"input",ref:s,type:"number",step:D.step,"model-value":i(h),placeholder:D.placeholder,readonly:D.readonly,disabled:i(m),size:i(v),max:D.max,min:D.min,name:D.name,label:D.label,"validate-event":!1,onWheel:H[0]||(H[0]=Ge(()=>{},["prevent"])),onKeydown:[wt(Ge(b,["prevent"]),["up"]),wt(Ge(_,["prevent"]),["down"])],onBlur:B,onFocus:V,onInput:M,onChange:O},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","label","onKeydown"])],34))}});var $7=Ne(k7,[["__file","/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);const V2=it($7),E7=Me({type:{type:String,values:["primary","success","warning","info","danger","default"],default:"default"},underline:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},href:{type:String,default:""},icon:{type:Rt}}),T7={click:e=>e instanceof MouseEvent},O7=["href"],N7=G({name:"ElLink"}),M7=G({...N7,props:E7,emits:T7,setup(e,{emit:t}){const n=e,o=ye("link"),r=C(()=>[o.b(),o.m(n.type),o.is("disabled",n.disabled),o.is("underline",n.underline&&!n.disabled)]);function l(s){n.disabled||t("click",s)}return(s,a)=>(S(),x("a",{class:E(i(r)),href:s.disabled||!s.href?void 0:s.href,onClick:l},[s.icon?(S(),ae(i(ze),{key:0},{default:q(()=>[(S(),ae(vt(s.icon)))]),_:1})):oe("v-if",!0),s.$slots.default?(S(),x("span",{key:1,class:E(i(o).e("inner"))},[ve(s.$slots,"default")],2)):oe("v-if",!0),s.$slots.icon?ve(s.$slots,"icon",{key:2}):oe("v-if",!0)],10,O7))}});var I7=Ne(M7,[["__file","/home/runner/work/element-plus/element-plus/packages/components/link/src/link.vue"]]);const z2=it(I7);let P7=class{constructor(t,n){this.parent=t,this.domNode=n,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(t){t===this.subMenuItems.length?t=0:t<0&&(t=this.subMenuItems.length-1),this.subMenuItems[t].focus(),this.subIndex=t}addListeners(){const t=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,n=>{n.addEventListener("keydown",o=>{let r=!1;switch(o.code){case We.down:{this.gotoSubIndex(this.subIndex+1),r=!0;break}case We.up:{this.gotoSubIndex(this.subIndex-1),r=!0;break}case We.tab:{Bi(t,"mouseleave");break}case We.enter:case We.space:{r=!0,o.currentTarget.click();break}}return r&&(o.preventDefault(),o.stopPropagation()),!1})})}},R7=class{constructor(t,n){this.domNode=t,this.submenu=null,this.submenu=null,this.init(n)}init(t){this.domNode.setAttribute("tabindex","0");const n=this.domNode.querySelector(`.${t}-menu`);n&&(this.submenu=new P7(this,n)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",t=>{let n=!1;switch(t.code){case We.down:{Bi(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),n=!0;break}case We.up:{Bi(t.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),n=!0;break}case We.tab:{Bi(t.currentTarget,"mouseleave");break}case We.enter:case We.space:{n=!0,t.currentTarget.click();break}}n&&t.preventDefault()})}},A7=class{constructor(t,n){this.domNode=t,this.init(n)}init(t){const n=this.domNode.childNodes;Array.from(n).forEach(o=>{o.nodeType===1&&new R7(o,t)})}};const x7=G({name:"ElMenuCollapseTransition",setup(){const e=ye("menu");return{listeners:{onBeforeEnter:n=>n.style.opacity="0.2",onEnter(n,o){To(n,`${e.namespace.value}-opacity-transition`),n.style.opacity="1",o()},onAfterEnter(n){In(n,`${e.namespace.value}-opacity-transition`),n.style.opacity=""},onBeforeLeave(n){n.dataset||(n.dataset={}),po(n,e.m("collapse"))?(In(n,e.m("collapse")),n.dataset.oldOverflow=n.style.overflow,n.dataset.scrollWidth=n.clientWidth.toString(),To(n,e.m("collapse"))):(To(n,e.m("collapse")),n.dataset.oldOverflow=n.style.overflow,n.dataset.scrollWidth=n.clientWidth.toString(),In(n,e.m("collapse"))),n.style.width=`${n.scrollWidth}px`,n.style.overflow="hidden"},onLeave(n){To(n,"horizontal-collapse-transition"),n.style.width=`${n.dataset.scrollWidth}px`}}}}});function L7(e,t,n,o,r,l){return S(),ae(Yt,pt({mode:"out-in"},e.listeners),{default:q(()=>[ve(e.$slots,"default")]),_:3},16)}var D7=Ne(x7,[["render",L7],["__file","/home/runner/work/element-plus/element-plus/packages/components/menu/src/menu-collapse-transition.vue"]]);function H2(e,t){const n=C(()=>{let r=e.parent;const l=[t.value];for(;r.type.name!=="ElMenu";)r.props.index&&l.unshift(r.props.index),r=r.parent;return l});return{parentMenu:C(()=>{let r=e.parent;for(;r&&!["ElMenu","ElSubMenu"].includes(r.type.name);)r=r.parent;return r}),indexPath:n}}function B7(e){return C(()=>{const n=e.backgroundColor;return n?new _w(n).shade(20).toString():""})}const K2=(e,t)=>{const n=ye("menu");return C(()=>n.cssVarBlock({"text-color":e.textColor||"","hover-text-color":e.textColor||"","bg-color":e.backgroundColor||"","hover-bg-color":B7(e).value||"","active-color":e.activeTextColor||"",level:`${t}`}))},F7=Me({index:{type:String,required:!0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},popperClass:String,disabled:Boolean,popperAppendToBody:{type:Boolean,default:void 0},teleported:{type:Boolean,default:void 0},popperOffset:{type:Number,default:6},expandCloseIcon:{type:Rt},expandOpenIcon:{type:Rt},collapseCloseIcon:{type:Rt},collapseOpenIcon:{type:Rt}}),Mi="ElSubMenu";var $h=G({name:Mi,props:F7,setup(e,{slots:t,expose:n}){Ro({from:"popper-append-to-body",replacement:"teleported",scope:Mi,version:"2.3.0",ref:"https://element-plus.org/en-US/component/menu.html#submenu-attributes"},C(()=>e.popperAppendToBody!==void 0));const o=ut(),{indexPath:r,parentMenu:l}=H2(o,C(()=>e.index)),s=ye("menu"),a=ye("sub-menu"),u=De("rootMenu");u||en(Mi,"can not inject root menu");const c=De(`subMenu:${l.value.uid}`);c||en(Mi,"can not inject sub menu");const d=N({}),f=N({});let p;const v=N(!1),m=N(),h=N(null),g=C(()=>V.value==="horizontal"&&w.value?"bottom-start":"right-start"),y=C(()=>V.value==="horizontal"&&w.value||V.value==="vertical"&&!u.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?$.value?e.expandOpenIcon:e.expandCloseIcon:xr:e.collapseCloseIcon&&e.collapseOpenIcon?$.value?e.collapseOpenIcon:e.collapseCloseIcon:_n),w=C(()=>c.level===0),b=C(()=>{var R;const U=(R=e.teleported)!=null?R:e.popperAppendToBody;return U===void 0?w.value:U}),_=C(()=>u.props.collapse?`${s.namespace.value}-zoom-in-left`:`${s.namespace.value}-zoom-in-top`),k=C(()=>V.value==="horizontal"&&w.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","left-start","bottom-start","bottom-end","top-start","top-end"]),$=C(()=>u.openedMenus.includes(e.index)),M=C(()=>{let R=!1;return Object.values(d.value).forEach(U=>{U.active&&(R=!0)}),Object.values(f.value).forEach(U=>{U.active&&(R=!0)}),R}),O=C(()=>u.props.backgroundColor||""),P=C(()=>u.props.activeTextColor||""),A=C(()=>u.props.textColor||""),V=C(()=>u.props.mode),B=yt({index:e.index,indexPath:r,active:M}),D=C(()=>V.value!=="horizontal"?{color:A.value}:{borderBottomColor:M.value?u.props.activeTextColor?P.value:"":"transparent",color:M.value?P.value:A.value}),H=()=>{var R,U,ne;return(ne=(U=(R=h.value)==null?void 0:R.popperRef)==null?void 0:U.popperInstanceRef)==null?void 0:ne.destroy()},W=R=>{R||H()},F=()=>{u.props.menuTrigger==="hover"&&u.props.mode==="horizontal"||u.props.collapse&&u.props.mode==="vertical"||e.disabled||u.handleSubMenuClick({index:e.index,indexPath:r.value,active:M.value})},T=(R,U=e.showTimeout)=>{var ne;R.type!=="focus"&&(u.props.menuTrigger==="click"&&u.props.mode==="horizontal"||!u.props.collapse&&u.props.mode==="vertical"||e.disabled||(c.mouseInChild.value=!0,p==null||p(),{stop:p}=pl(()=>{u.openMenu(e.index,r.value)},U),b.value&&((ne=l.value.vnode.el)==null||ne.dispatchEvent(new MouseEvent("mouseenter")))))},L=(R=!1)=>{var U,ne;u.props.menuTrigger==="click"&&u.props.mode==="horizontal"||!u.props.collapse&&u.props.mode==="vertical"||(p==null||p(),c.mouseInChild.value=!1,{stop:p}=pl(()=>!v.value&&u.closeMenu(e.index,r.value),e.hideTimeout),b.value&&R&&((U=o.parent)==null?void 0:U.type.name)==="ElSubMenu"&&((ne=c.handleMouseleave)==null||ne.call(c,!0)))};me(()=>u.props.collapse,R=>W(!!R));{const R=ne=>{f.value[ne.index]=ne},U=ne=>{delete f.value[ne.index]};ht(`subMenu:${o.uid}`,{addSubMenu:R,removeSubMenu:U,handleMouseleave:L,mouseInChild:v,level:c.level+1})}return n({opened:$}),tt(()=>{u.addSubMenu(B),c.addSubMenu(B)}),Dt(()=>{c.removeSubMenu(B),u.removeSubMenu(B)}),()=>{var R;const U=[(R=t.title)==null?void 0:R.call(t),je(ze,{class:a.e("icon-arrow"),style:{transform:$.value?e.expandCloseIcon&&e.expandOpenIcon||e.collapseCloseIcon&&e.collapseOpenIcon&&u.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>Ze(y.value)?je(o.appContext.components[y.value]):je(y.value)})],ne=K2(u.props,c.level+1),j=u.isMenuPopup?je(En,{ref:h,visible:$.value,effect:"light",pure:!0,offset:e.popperOffset,showArrow:!1,persistent:!0,popperClass:e.popperClass,placement:g.value,teleported:b.value,fallbackPlacements:k.value,transition:_.value,gpuAcceleration:!1},{content:()=>{var Q;return je("div",{class:[s.m(V.value),s.m("popup-container"),e.popperClass],onMouseenter:he=>T(he,100),onMouseleave:()=>L(!0),onFocus:he=>T(he,100)},[je("ul",{class:[s.b(),s.m("popup"),s.m(`popup-${g.value}`)],style:ne.value},[(Q=t.default)==null?void 0:Q.call(t)])])},default:()=>je("div",{class:a.e("title"),style:[D.value,{backgroundColor:O.value}],onClick:F},U)}):je(xe,{},[je("div",{class:a.e("title"),style:[D.value,{backgroundColor:O.value}],ref:m,onClick:F},U),je(_c,{},{default:()=>{var Q;return et(je("ul",{role:"menu",class:[s.b(),s.m("inline")],style:ne.value},[(Q=t.default)==null?void 0:Q.call(t)]),[[kt,$.value]])}})]);return je("li",{class:[a.b(),a.is("active",M.value),a.is("opened",$.value),a.is("disabled",e.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:$.value,onMouseenter:T,onMouseleave:()=>L(!0),onFocus:T},[j])}}});const V7=Me({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:se(Array),default:()=>Ft([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperEffect:{type:String,values:["dark","light"],default:"dark"}}),od=e=>Array.isArray(e)&&e.every(t=>Ze(t)),z7={close:(e,t)=>Ze(e)&&od(t),open:(e,t)=>Ze(e)&&od(t),select:(e,t,n,o)=>Ze(e)&&od(t)&&ft(n)&&(o===void 0||o instanceof Promise)};var H7=G({name:"ElMenu",props:V7,emits:z7,setup(e,{emit:t,slots:n,expose:o}){const r=ut(),l=r.appContext.config.globalProperties.$router,s=N(),a=ye("menu"),u=ye("sub-menu"),c=N(-1),d=N(e.defaultOpeneds&&!e.collapse?e.defaultOpeneds.slice(0):[]),f=N(e.defaultActive),p=N({}),v=N({}),m=C(()=>e.mode==="horizontal"||e.mode==="vertical"&&e.collapse),h=()=>{const V=f.value&&p.value[f.value];if(!V||e.mode==="horizontal"||e.collapse)return;V.indexPath.forEach(D=>{const H=v.value[D];H&&g(D,H.indexPath)})},g=(V,B)=>{d.value.includes(V)||(e.uniqueOpened&&(d.value=d.value.filter(D=>B.includes(D))),d.value.push(V),t("open",V,B))},y=V=>{const B=d.value.indexOf(V);B!==-1&&d.value.splice(B,1)},w=(V,B)=>{y(V),t("close",V,B)},b=({index:V,indexPath:B})=>{d.value.includes(V)?w(V,B):g(V,B)},_=V=>{(e.mode==="horizontal"||e.collapse)&&(d.value=[]);const{index:B,indexPath:D}=V;if(!(B===void 0||D===void 0))if(e.router&&l){const H=V.route||B,W=l.push(H).then(F=>(F||(f.value=B),F));t("select",B,D,{index:B,indexPath:D,route:H},W)}else f.value=B,t("select",B,D,{index:B,indexPath:D})},k=V=>{const B=p.value,D=B[V]||f.value&&B[f.value]||B[e.defaultActive];D?f.value=D.index:f.value=V},$=()=>{var V,B;if(!s.value)return-1;const D=Array.from((B=(V=s.value)==null?void 0:V.childNodes)!=null?B:[]).filter(U=>U.nodeName!=="#text"||U.nodeValue),H=64,W=Number.parseInt(getComputedStyle(s.value).paddingLeft,10),F=Number.parseInt(getComputedStyle(s.value).paddingRight,10),T=s.value.clientWidth-W-F;let L=0,R=0;return D.forEach((U,ne)=>{L+=U.offsetWidth||0,L<=T-H&&(R=ne+1)}),R===D.length?-1:R},M=(V,B=33.34)=>{let D;return()=>{D&&clearTimeout(D),D=setTimeout(()=>{V()},B)}};let O=!0;const P=()=>{const V=()=>{c.value=-1,Ke(()=>{c.value=$()})};O?V():M(V)(),O=!1};me(()=>e.defaultActive,V=>{p.value[V]||(f.value=""),k(V)}),me(()=>e.collapse,V=>{V&&(d.value=[])}),me(p.value,h);let A;Kn(()=>{e.mode==="horizontal"&&e.ellipsis?A=gn(s,P).stop:A==null||A()});{const V=W=>{v.value[W.index]=W},B=W=>{delete v.value[W.index]};ht("rootMenu",yt({props:e,openedMenus:d,items:p,subMenus:v,activeIndex:f,isMenuPopup:m,addMenuItem:W=>{p.value[W.index]=W},removeMenuItem:W=>{delete p.value[W.index]},addSubMenu:V,removeSubMenu:B,openMenu:g,closeMenu:w,handleMenuItemClick:_,handleSubMenuClick:b})),ht(`subMenu:${r.uid}`,{addSubMenu:V,removeSubMenu:B,mouseInChild:N(!1),level:0})}return tt(()=>{e.mode==="horizontal"&&new A7(r.vnode.el,a.namespace.value)}),o({open:B=>{const{indexPath:D}=v.value[B];D.forEach(H=>g(H,D))},close:y,handleResize:P}),()=>{var V,B;let D=(B=(V=n.default)==null?void 0:V.call(n))!=null?B:[];const H=[];if(e.mode==="horizontal"&&s.value){const T=jl(D),L=c.value===-1?T:T.slice(0,c.value),R=c.value===-1?[]:T.slice(c.value);R!=null&&R.length&&e.ellipsis&&(D=L,H.push(je($h,{index:"sub-menu-more",class:u.e("hide-arrow")},{title:()=>je(ze,{class:u.e("icon-more")},{default:()=>je(tR)}),default:()=>R})))}const W=K2(e,0),F=je("ul",{key:String(e.collapse),role:"menubar",ref:s,style:W.value,class:{[a.b()]:!0,[a.m(e.mode)]:!0,[a.m("collapse")]:e.collapse}},[...D,...H]);return e.collapseTransition&&e.mode==="vertical"?je(D7,()=>F):F}}});const K7=Me({index:{type:se([String,null]),default:null},route:{type:se([String,Object])},disabled:Boolean}),j7={click:e=>Ze(e.index)&&Array.isArray(e.indexPath)},rd="ElMenuItem",W7=G({name:rd,components:{ElTooltip:En},props:K7,emits:j7,setup(e,{emit:t}){const n=ut(),o=De("rootMenu"),r=ye("menu"),l=ye("menu-item");o||en(rd,"can not inject root menu");const{parentMenu:s,indexPath:a}=H2(n,Lt(e,"index")),u=De(`subMenu:${s.value.uid}`);u||en(rd,"can not inject sub menu");const c=C(()=>e.index===o.activeIndex),d=yt({index:e.index,indexPath:a,active:c}),f=()=>{e.disabled||(o.handleMenuItemClick({index:e.index,indexPath:a.value,route:e.route}),t("click",d))};return tt(()=>{u.addSubMenu(d),o.addMenuItem(d)}),Dt(()=>{u.removeSubMenu(d),o.removeMenuItem(d)}),{parentMenu:s,rootMenu:o,active:c,nsMenu:r,nsMenuItem:l,handleClick:f}}});function U7(e,t,n,o,r,l){const s=Qe("el-tooltip");return S(),x("li",{class:E([e.nsMenuItem.b(),e.nsMenuItem.is("active",e.active),e.nsMenuItem.is("disabled",e.disabled)]),role:"menuitem",tabindex:"-1",onClick:t[0]||(t[0]=(...a)=>e.handleClick&&e.handleClick(...a))},[e.parentMenu.type.name==="ElMenu"&&e.rootMenu.props.collapse&&e.$slots.title?(S(),ae(s,{key:0,effect:e.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:q(()=>[ve(e.$slots,"title")]),default:q(()=>[I("div",{class:E(e.nsMenu.be("tooltip","trigger"))},[ve(e.$slots,"default")],2)]),_:3},8,["effect"])):(S(),x(xe,{key:1},[ve(e.$slots,"default"),ve(e.$slots,"title")],64))],2)}var j2=Ne(W7,[["render",U7],["__file","/home/runner/work/element-plus/element-plus/packages/components/menu/src/menu-item.vue"]]);const q7={title:String},Y7="ElMenuItemGroup",G7=G({name:Y7,props:q7,setup(){return{ns:ye("menu-item-group")}}});function X7(e,t,n,o,r,l){return S(),x("li",{class:E(e.ns.b())},[I("div",{class:E(e.ns.e("title"))},[e.$slots.title?ve(e.$slots,"title",{key:1}):(S(),x(xe,{key:0},[nt(ue(e.title),1)],64))],2),I("ul",null,[ve(e.$slots,"default")])],2)}var W2=Ne(G7,[["render",X7],["__file","/home/runner/work/element-plus/element-plus/packages/components/menu/src/menu-item-group.vue"]]);const J7=it(H7,{MenuItem:j2,MenuItemGroup:W2,SubMenu:$h}),Z7=jt(j2),Q7=jt(W2),ej=jt($h),tj=Me({icon:{type:Rt,default:()=>BM},title:String,content:{type:String,default:""}}),nj={back:()=>!0},oj=["aria-label"],rj=G({name:"ElPageHeader"}),lj=G({...rj,props:tj,emits:nj,setup(e,{emit:t}){const n=cn(),{t:o}=Ct(),r=ye("page-header"),l=C(()=>[r.b(),{[r.m("has-breadcrumb")]:!!n.breadcrumb,[r.m("has-extra")]:!!n.extra,[r.is("contentful")]:!!n.default}]);function s(){t("back")}return(a,u)=>(S(),x("div",{class:E(i(l))},[a.$slots.breadcrumb?(S(),x("div",{key:0,class:E(i(r).e("breadcrumb"))},[ve(a.$slots,"breadcrumb")],2)):oe("v-if",!0),I("div",{class:E(i(r).e("header"))},[I("div",{class:E(i(r).e("left"))},[I("div",{class:E(i(r).e("back")),role:"button",tabindex:"0",onClick:s},[a.icon||a.$slots.icon?(S(),x("div",{key:0,"aria-label":a.title||i(o)("el.pageHeader.title"),class:E(i(r).e("icon"))},[ve(a.$slots,"icon",{},()=>[a.icon?(S(),ae(i(ze),{key:0},{default:q(()=>[(S(),ae(vt(a.icon)))]),_:1})):oe("v-if",!0)])],10,oj)):oe("v-if",!0),I("div",{class:E(i(r).e("title"))},[ve(a.$slots,"title",{},()=>[nt(ue(a.title||i(o)("el.pageHeader.title")),1)])],2)],2),z(i(M2),{direction:"vertical"}),I("div",{class:E(i(r).e("content"))},[ve(a.$slots,"content",{},()=>[nt(ue(a.content),1)])],2)],2),a.$slots.extra?(S(),x("div",{key:0,class:E(i(r).e("extra"))},[ve(a.$slots,"extra")],2)):oe("v-if",!0)],2),a.$slots.default?(S(),x("div",{key:1,class:E(i(r).e("main"))},[ve(a.$slots,"default")],2)):oe("v-if",!0)],2))}});var sj=Ne(lj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/page-header/src/page-header.vue"]]);const aj=it(sj),U2=Symbol("elPaginationKey"),ij=Me({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:Rt}}),uj={click:e=>e instanceof MouseEvent},cj=["disabled","aria-label","aria-disabled"],dj={key:0},fj=G({name:"ElPaginationPrev"}),pj=G({...fj,props:ij,emits:uj,setup(e){const t=e,{t:n}=Ct(),o=C(()=>t.disabled||t.currentPage<=1);return(r,l)=>(S(),x("button",{type:"button",class:"btn-prev",disabled:i(o),"aria-label":r.prevText||i(n)("el.pagination.prev"),"aria-disabled":i(o),onClick:l[0]||(l[0]=s=>r.$emit("click",s))},[r.prevText?(S(),x("span",dj,ue(r.prevText),1)):(S(),ae(i(ze),{key:1},{default:q(()=>[(S(),ae(vt(r.prevIcon)))]),_:1}))],8,cj))}});var hj=Ne(pj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/prev.vue"]]);const vj=Me({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:Rt}}),mj=["disabled","aria-label","aria-disabled"],gj={key:0},yj=G({name:"ElPaginationNext"}),bj=G({...yj,props:vj,emits:["click"],setup(e){const t=e,{t:n}=Ct(),o=C(()=>t.disabled||t.currentPage===t.pageCount||t.pageCount===0);return(r,l)=>(S(),x("button",{type:"button",class:"btn-next",disabled:i(o),"aria-label":r.nextText||i(n)("el.pagination.next"),"aria-disabled":i(o),onClick:l[0]||(l[0]=s=>r.$emit("click",s))},[r.nextText?(S(),x("span",gj,ue(r.nextText),1)):(S(),ae(i(ze),{key:1},{default:q(()=>[(S(),ae(vt(r.nextIcon)))]),_:1}))],8,mj))}});var wj=Ne(bj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/next.vue"]]);const q2=Symbol("ElSelectGroup"),ti=Symbol("ElSelect");function _j(e,t){const n=De(ti),o=De(q2,{disabled:!1}),r=C(()=>Object.prototype.toString.call(e.value).toLowerCase()==="[object object]"),l=C(()=>n.props.multiple?f(n.props.modelValue,e.value):p(e.value,n.props.modelValue)),s=C(()=>{if(n.props.multiple){const h=n.props.modelValue||[];return!l.value&&h.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),a=C(()=>e.label||(r.value?"":e.value)),u=C(()=>e.value||e.label||""),c=C(()=>e.disabled||t.groupDisabled||s.value),d=ut(),f=(h=[],g)=>{if(r.value){const y=n.props.valueKey;return h&&h.some(w=>Et(Bt(w,y))===Bt(g,y))}else return h&&h.includes(g)},p=(h,g)=>{if(r.value){const{valueKey:y}=n.props;return Bt(h,y)===Bt(g,y)}else return h===g},v=()=>{!e.disabled&&!o.disabled&&(n.hoverIndex=n.optionsArray.indexOf(d.proxy))};me(()=>a.value,()=>{!e.created&&!n.props.remote&&n.setSelected()}),me(()=>e.value,(h,g)=>{const{remote:y,valueKey:w}=n.props;if(Object.is(h,g)||(n.onOptionDestroy(g,d.proxy),n.onOptionCreate(d.proxy)),!e.created&&!y){if(w&&typeof h=="object"&&typeof g=="object"&&h[w]===g[w])return;n.setSelected()}}),me(()=>o.disabled,()=>{t.groupDisabled=o.disabled},{immediate:!0});const{queryChange:m}=Et(n);return me(m,h=>{const{query:g}=i(h),y=new RegExp(t1(g),"i");t.visible=y.test(a.value)||e.created,t.visible||n.filteredOptionsCount--},{immediate:!0}),{select:n,currentLabel:a,currentValue:u,itemSelected:l,isDisabled:c,hoverItem:v}}const Cj=G({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},setup(e){const t=ye("select"),n=yt({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),{currentLabel:o,itemSelected:r,isDisabled:l,select:s,hoverItem:a}=_j(e,n),{visible:u,hover:c}=Qt(n),d=ut().proxy;s.onOptionCreate(d),Dt(()=>{const p=d.value,{selected:v}=s,h=(s.props.multiple?v:[v]).some(g=>g.value===d.value);Ke(()=>{s.cachedOptions.get(p)===d&&!h&&s.cachedOptions.delete(p)}),s.onOptionDestroy(p,d)});function f(){e.disabled!==!0&&n.groupDisabled!==!0&&s.handleOptionSelect(d,!0)}return{ns:t,currentLabel:o,itemSelected:r,isDisabled:l,select:s,hoverItem:a,visible:u,hover:c,selectOptionClick:f,states:n}}});function Sj(e,t,n,o,r,l){return et((S(),x("li",{class:E([e.ns.be("dropdown","item"),e.ns.is("disabled",e.isDisabled),{selected:e.itemSelected,hover:e.hover}]),onMouseenter:t[0]||(t[0]=(...s)=>e.hoverItem&&e.hoverItem(...s)),onClick:t[1]||(t[1]=Ge((...s)=>e.selectOptionClick&&e.selectOptionClick(...s),["stop"]))},[ve(e.$slots,"default",{},()=>[I("span",null,ue(e.currentLabel),1)])],34)),[[kt,e.visible]])}var Eh=Ne(Cj,[["render",Sj],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);const kj=G({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=De(ti),t=ye("select"),n=C(()=>e.props.popperClass),o=C(()=>e.props.multiple),r=C(()=>e.props.fitInputWidth),l=N("");function s(){var a;l.value=`${(a=e.selectWrapper)==null?void 0:a.offsetWidth}px`}return tt(()=>{s(),gn(e.selectWrapper,s)}),{ns:t,minWidth:l,popperClass:n,isMultiple:o,isFitInputWidth:r}}});function $j(e,t,n,o,r,l){return S(),x("div",{class:E([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:He({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[ve(e.$slots,"default")],6)}var Ej=Ne(kj,[["render",$j],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);function Tj(e){const{t}=Ct();return yt({options:new Map,cachedOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1,prefixWidth:11,tagInMultiLine:!1,mouseEnter:!1})}const Oj=(e,t,n)=>{const{t:o}=Ct(),r=ye("select");Ro({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},C(()=>e.suffixTransition===!1));const l=N(null),s=N(null),a=N(null),u=N(null),c=N(null),d=N(null),f=N(null),p=N(-1),v=Pt({query:""}),m=Pt(""),h=N([]);let g=0;const{form:y,formItem:w}=Tn(),b=C(()=>!e.filterable||e.multiple||!t.visible),_=C(()=>e.disabled||(y==null?void 0:y.disabled)),k=C(()=>{const we=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:e.modelValue!==void 0&&e.modelValue!==null&&e.modelValue!=="";return e.clearable&&!_.value&&t.inputHovering&&we}),$=C(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),M=C(()=>r.is("reverse",$.value&&t.visible&&e.suffixTransition)),O=C(()=>e.remote?300:0),P=C(()=>e.loading?e.loadingText||o("el.select.loading"):e.remote&&t.query===""&&t.options.size===0?!1:e.filterable&&t.query&&t.options.size>0&&t.filteredOptionsCount===0?e.noMatchText||o("el.select.noMatch"):t.options.size===0?e.noDataText||o("el.select.noData"):null),A=C(()=>{const we=Array.from(t.options.values()),Fe=[];return h.value.forEach(at=>{const ct=we.findIndex(mt=>mt.currentLabel===at);ct>-1&&Fe.push(we[ct])}),Fe.length?Fe:we}),V=C(()=>Array.from(t.cachedOptions.values())),B=C(()=>{const we=A.value.filter(Fe=>!Fe.created).some(Fe=>Fe.currentLabel===t.query);return e.filterable&&e.allowCreate&&t.query!==""&&!we}),D=Jt(),H=C(()=>["small"].includes(D.value)?"small":"default"),W=C({get(){return t.visible&&P.value!==!1},set(we){t.visible=we}});me([()=>_.value,()=>D.value,()=>y==null?void 0:y.size],()=>{Ke(()=>{F()})}),me(()=>e.placeholder,we=>{t.cachedPlaceHolder=t.currentPlaceholder=we}),me(()=>e.modelValue,(we,Fe)=>{e.multiple&&(F(),we&&we.length>0||s.value&&t.query!==""?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",T(t.query))),U(),e.filterable&&!e.multiple&&(t.inputLength=20),!jn(we,Fe)&&e.validateEvent&&(w==null||w.validate("change").catch(at=>void 0))},{flush:"post",deep:!0}),me(()=>t.visible,we=>{var Fe,at,ct,mt,Tt;we?((at=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||at.call(Fe),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,(mt=(ct=a.value)==null?void 0:ct.focus)==null||mt.call(ct),e.multiple?(Tt=s.value)==null||Tt.focus():t.selectedLabel&&(t.currentPlaceholder=`${t.selectedLabel}`,t.selectedLabel=""),T(t.query),!e.multiple&&!e.remote&&(v.value.query="",Os(v),Os(m)))):(e.filterable&&(Je(e.filterMethod)&&e.filterMethod(""),Je(e.remoteMethod)&&e.remoteMethod("")),s.value&&s.value.blur(),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,j(),Ke(()=>{s.value&&s.value.value===""&&t.selected.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)}),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),n.emit("visible-change",we)}),me(()=>t.options.entries(),()=>{var we,Fe,at;if(!bt)return;(Fe=(we=u.value)==null?void 0:we.updatePopper)==null||Fe.call(we),e.multiple&&F();const ct=((at=d.value)==null?void 0:at.querySelectorAll("input"))||[];Array.from(ct).includes(document.activeElement)||U(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&R()},{flush:"post"}),me(()=>t.hoverIndex,we=>{Xe(we)&&we>-1?p.value=A.value[we]||{}:p.value={},A.value.forEach(Fe=>{Fe.hover=p.value===Fe})});const F=()=>{Ke(()=>{var we,Fe;if(!l.value)return;const at=l.value.$el.querySelector("input");g=g||(at.clientHeight>0?at.clientHeight+2:0);const ct=c.value,mt=QA(D.value||(y==null?void 0:y.size)),Tt=mt===g||g<=0?mt:g;!(at.offsetParent===null)&&(at.style.height=`${(t.selected.length===0?Tt:Math.max(ct?ct.clientHeight+(ct.clientHeight>Tt?6:0):0,Tt))-2}px`),t.tagInMultiLine=Number.parseFloat(at.style.height)>=Tt,t.visible&&P.value!==!1&&((Fe=(we=u.value)==null?void 0:we.updatePopper)==null||Fe.call(we))})},T=async we=>{if(!(t.previousQuery===we||t.isOnComposition)){if(t.previousQuery===null&&(Je(e.filterMethod)||Je(e.remoteMethod))){t.previousQuery=we;return}t.previousQuery=we,Ke(()=>{var Fe,at;t.visible&&((at=(Fe=u.value)==null?void 0:Fe.updatePopper)==null||at.call(Fe))}),t.hoverIndex=-1,e.multiple&&e.filterable&&Ke(()=>{const Fe=s.value.value.length*15+20;t.inputLength=e.collapseTags?Math.min(50,Fe):Fe,L(),F()}),e.remote&&Je(e.remoteMethod)?(t.hoverIndex=-1,e.remoteMethod(we)):Je(e.filterMethod)?(e.filterMethod(we),Os(m)):(t.filteredOptionsCount=t.optionsCount,v.value.query=we,Os(v),Os(m)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&(await Ke(),R())}},L=()=>{t.currentPlaceholder!==""&&(t.currentPlaceholder=s.value.value?"":t.cachedPlaceHolder)},R=()=>{const we=A.value.filter(ct=>ct.visible&&!ct.disabled&&!ct.states.groupDisabled),Fe=we.find(ct=>ct.created),at=we[0];t.hoverIndex=J(A.value,Fe||at)},U=()=>{var we;if(e.multiple)t.selectedLabel="";else{const at=ne(e.modelValue);(we=at.props)!=null&&we.created?(t.createdLabel=at.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=at.currentLabel,t.selected=at,e.filterable&&(t.query=t.selectedLabel);return}const Fe=[];Array.isArray(e.modelValue)&&e.modelValue.forEach(at=>{Fe.push(ne(at))}),t.selected=Fe,Ke(()=>{F()})},ne=we=>{let Fe;const at=Ri(we).toLowerCase()==="object",ct=Ri(we).toLowerCase()==="null",mt=Ri(we).toLowerCase()==="undefined";for(let $e=t.cachedOptions.size-1;$e>=0;$e--){const Ue=V.value[$e];if(at?Bt(Ue.value,e.valueKey)===Bt(we,e.valueKey):Ue.value===we){Fe={value:we,currentLabel:Ue.currentLabel,isDisabled:Ue.isDisabled};break}}if(Fe)return Fe;const Tt=at?we.label:!ct&&!mt?we:"",tn={value:we,currentLabel:Tt};return e.multiple&&(tn.hitState=!1),tn},j=()=>{setTimeout(()=>{const we=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map(Fe=>A.value.findIndex(at=>Bt(at,we)===Bt(Fe,we)))):t.hoverIndex=-1:t.hoverIndex=A.value.findIndex(Fe=>ke(Fe)===ke(t.selected))},300)},Q=()=>{var we,Fe;he(),(Fe=(we=u.value)==null?void 0:we.updatePopper)==null||Fe.call(we),e.multiple&&F()},he=()=>{var we;t.inputWidth=(we=l.value)==null?void 0:we.$el.offsetWidth},ee=()=>{e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,T(t.query))},Z=$n(()=>{ee()},O.value),te=$n(we=>{T(we.target.value)},O.value),X=we=>{jn(e.modelValue,we)||n.emit(At,we)},le=we=>{if(we.target.value.length<=0&&!be()){const Fe=e.modelValue.slice();Fe.pop(),n.emit(dt,Fe),X(Fe)}we.target.value.length===1&&e.modelValue.length===0&&(t.currentPlaceholder=t.cachedPlaceHolder)},de=(we,Fe)=>{const at=t.selected.indexOf(Fe);if(at>-1&&!_.value){const ct=e.modelValue.slice();ct.splice(at,1),n.emit(dt,ct),X(ct),n.emit("remove-tag",Fe.value)}we.stopPropagation()},Ie=we=>{we.stopPropagation();const Fe=e.multiple?[]:"";if(!Ze(Fe))for(const at of t.selected)at.isDisabled&&Fe.push(at.value);n.emit(dt,Fe),X(Fe),t.hoverIndex=-1,t.visible=!1,n.emit("clear")},K=(we,Fe)=>{var at;if(e.multiple){const ct=(e.modelValue||[]).slice(),mt=J(ct,we.value);mt>-1?ct.splice(mt,1):(e.multipleLimit<=0||ct.length{ge(we)})},J=(we=[],Fe)=>{if(!ft(Fe))return we.indexOf(Fe);const at=e.valueKey;let ct=-1;return we.some((mt,Tt)=>Et(Bt(mt,at))===Bt(Fe,at)?(ct=Tt,!0):!1),ct},fe=()=>{t.softFocus=!0;const we=s.value||l.value;we&&(we==null||we.focus())},ge=we=>{var Fe,at,ct,mt,Tt;const tn=Array.isArray(we)?we[0]:we;let $e=null;if(tn!=null&&tn.value){const Ue=A.value.filter(St=>St.value===tn.value);Ue.length>0&&($e=Ue[0].$el)}if(u.value&&$e){const Ue=(mt=(ct=(at=(Fe=u.value)==null?void 0:Fe.popperRef)==null?void 0:at.contentRef)==null?void 0:ct.querySelector)==null?void 0:mt.call(ct,`.${r.be("dropdown","wrap")}`);Ue&&r1(Ue,$e)}(Tt=f.value)==null||Tt.handleScroll()},Oe=we=>{t.optionsCount++,t.filteredOptionsCount++,t.options.set(we.value,we),t.cachedOptions.set(we.value,we)},ce=(we,Fe)=>{t.options.get(we)===Fe&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(we))},Te=we=>{we.code!==We.backspace&&be(!1),t.inputLength=s.value.value.length*15+20,F()},be=we=>{if(!Array.isArray(t.selected))return;const Fe=t.selected[t.selected.length-1];if(Fe)return we===!0||we===!1?(Fe.hitState=we,we):(Fe.hitState=!Fe.hitState,Fe.hitState)},Ee=we=>{const Fe=we.target.value;if(we.type==="compositionend")t.isOnComposition=!1,Ke(()=>T(Fe));else{const at=Fe[Fe.length-1]||"";t.isOnComposition=!cc(at)}},_e=()=>{Ke(()=>ge(t.selected))},Le=we=>{t.softFocus?t.softFocus=!1:((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),n.emit("focus",we))},Re=()=>{var we,Fe,at;t.visible=!1,(we=l.value)==null||we.blur(),(at=(Fe=a.value)==null?void 0:Fe.blur)==null||at.call(Fe)},pe=we=>{Ke(()=>{t.isSilentBlur?t.isSilentBlur=!1:n.emit("blur",we)}),t.softFocus=!1},Ae=we=>{Ie(we)},qe=()=>{t.visible=!1},rt=we=>{t.visible&&(we.preventDefault(),we.stopPropagation(),t.visible=!1)},Ye=we=>{var Fe;we&&!t.mouseEnter||_.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:(!u.value||!u.value.isFocusInsideContent())&&(t.visible=!t.visible),t.visible&&((Fe=s.value||l.value)==null||Fe.focus()))},Se=()=>{t.visible?A.value[t.hoverIndex]&&K(A.value[t.hoverIndex],void 0):Ye()},ke=we=>ft(we.value)?Bt(we.value,e.valueKey):we.value,ie=C(()=>A.value.filter(we=>we.visible).every(we=>we.disabled)),Y=C(()=>t.selected.slice(0,e.maxCollapseTags)),re=C(()=>t.selected.slice(e.maxCollapseTags)),Ce=we=>{if(!t.visible){t.visible=!0;return}if(!(t.options.size===0||t.filteredOptionsCount===0)&&!t.isOnComposition&&!ie.value){we==="next"?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):we==="prev"&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));const Fe=A.value[t.hoverIndex];(Fe.disabled===!0||Fe.states.groupDisabled===!0||!Fe.visible)&&Ce(we),Ke(()=>ge(p.value))}};return{optionList:h,optionsArray:A,selectSize:D,handleResize:Q,debouncedOnInputChange:Z,debouncedQueryChange:te,deletePrevTag:le,deleteTag:de,deleteSelected:Ie,handleOptionSelect:K,scrollToOption:ge,readonly:b,resetInputHeight:F,showClose:k,iconComponent:$,iconReverse:M,showNewOption:B,collapseTagSize:H,setSelected:U,managePlaceholder:L,selectDisabled:_,emptyText:P,toggleLastOptionHitState:be,resetInputState:Te,handleComposition:Ee,onOptionCreate:Oe,onOptionDestroy:ce,handleMenuEnter:_e,handleFocus:Le,blur:Re,handleBlur:pe,handleClearClick:Ae,handleClose:qe,handleKeydownEscape:rt,toggleMenu:Ye,selectOption:Se,getValueKey:ke,navigateOptions:Ce,dropMenuVisible:W,queryChange:v,groupQueryChange:m,showTagList:Y,collapseTagList:re,reference:l,input:s,iOSInput:a,tooltipRef:u,tags:c,selectWrapper:d,scrollbar:f,handleMouseEnter:()=>{t.mouseEnter=!0},handleMouseLeave:()=>{t.mouseEnter=!1}}};var Nj=G({name:"ElOptions",emits:["update-options"],setup(e,{slots:t,emit:n}){let o=[];function r(l,s){if(l.length!==s.length)return!1;for(const[a]of l.entries())if(l[a]!=s[a])return!1;return!0}return()=>{var l,s;const a=(l=t.default)==null?void 0:l.call(t),u=[];function c(d){Array.isArray(d)&&d.forEach(f=>{var p,v,m,h;const g=(p=(f==null?void 0:f.type)||{})==null?void 0:p.name;g==="ElOptionGroup"?c(!Ze(f.children)&&!Array.isArray(f.children)&&Je((v=f.children)==null?void 0:v.default)?(m=f.children)==null?void 0:m.default():f.children):g==="ElOption"?u.push((h=f.props)==null?void 0:h.label):Array.isArray(f.children)&&c(f.children)})}return a.length&&c((s=a[0])==null?void 0:s.children),r(u,o)||(o=u,n("update-options",u)),a}}});const Yg="ElSelect",Mj=G({name:Yg,componentName:Yg,components:{ElInput:mn,ElSelectMenu:Ej,ElOption:Eh,ElOptions:Nj,ElTag:Ta,ElScrollbar:or,ElTooltip:En,ElIcon:ze},directives:{ClickOutside:Mr},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:uc},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{type:Number,default:1},teleported:sn.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Rt,default:Lr},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{type:Rt,default:xr},tagType:{...gh.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:{type:Boolean,default:!1},suffixTransition:{type:Boolean,default:!0},placement:{type:String,values:Cl,default:"bottom-start"}},emits:[dt,At,"remove-tag","clear","visible-change","focus","blur"],setup(e,t){const n=ye("select"),o=ye("input"),{t:r}=Ct(),l=Tj(e),{optionList:s,optionsArray:a,selectSize:u,readonly:c,handleResize:d,collapseTagSize:f,debouncedOnInputChange:p,debouncedQueryChange:v,deletePrevTag:m,deleteTag:h,deleteSelected:g,handleOptionSelect:y,scrollToOption:w,setSelected:b,resetInputHeight:_,managePlaceholder:k,showClose:$,selectDisabled:M,iconComponent:O,iconReverse:P,showNewOption:A,emptyText:V,toggleLastOptionHitState:B,resetInputState:D,handleComposition:H,onOptionCreate:W,onOptionDestroy:F,handleMenuEnter:T,handleFocus:L,blur:R,handleBlur:U,handleClearClick:ne,handleClose:j,handleKeydownEscape:Q,toggleMenu:he,selectOption:ee,getValueKey:Z,navigateOptions:te,dropMenuVisible:X,reference:le,input:de,iOSInput:Ie,tooltipRef:K,tags:J,selectWrapper:fe,scrollbar:ge,queryChange:Oe,groupQueryChange:ce,handleMouseEnter:Te,handleMouseLeave:be,showTagList:Ee,collapseTagList:_e}=Oj(e,l,t),{focus:Le}=sx(le),{inputWidth:Re,selected:pe,inputLength:Ae,filteredOptionsCount:qe,visible:rt,softFocus:Ye,selectedLabel:Se,hoverIndex:ke,query:ie,inputHovering:Y,currentPlaceholder:re,menuVisibleOnFocus:Ce,isOnComposition:Pe,isSilentBlur:ot,options:we,cachedOptions:Fe,optionsCount:at,prefixWidth:ct,tagInMultiLine:mt}=Qt(l),Tt=C(()=>{const $t=[n.b()],ln=i(u);return ln&&$t.push(n.m(ln)),e.disabled&&$t.push(n.m("disabled")),$t}),tn=C(()=>({maxWidth:`${i(Re)-32}px`,width:"100%"})),$e=C(()=>({maxWidth:`${i(Re)>123?i(Re)-123:i(Re)-75}px`}));ht(ti,yt({props:e,options:we,optionsArray:a,cachedOptions:Fe,optionsCount:at,filteredOptionsCount:qe,hoverIndex:ke,handleOptionSelect:y,onOptionCreate:W,onOptionDestroy:F,selectWrapper:fe,selected:pe,setSelected:b,queryChange:Oe,groupQueryChange:ce})),tt(()=>{l.cachedPlaceHolder=re.value=e.placeholder||(()=>r("el.select.placeholder")),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(re.value=""),gn(fe,d),e.remote&&e.multiple&&_(),Ke(()=>{const $t=le.value&&le.value.$el;if($t&&(Re.value=$t.getBoundingClientRect().width,t.slots.prefix)){const ln=$t.querySelector(`.${o.e("prefix")}`);ct.value=Math.max(ln.getBoundingClientRect().width+5,30)}}),b()}),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(dt,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(dt,"");const Ue=C(()=>{var $t,ln;return(ln=($t=K.value)==null?void 0:$t.popperRef)==null?void 0:ln.contentRef});return{isIOS:gb,onOptionsRendered:$t=>{s.value=$t},tagInMultiLine:mt,prefixWidth:ct,selectSize:u,readonly:c,handleResize:d,collapseTagSize:f,debouncedOnInputChange:p,debouncedQueryChange:v,deletePrevTag:m,deleteTag:h,deleteSelected:g,handleOptionSelect:y,scrollToOption:w,inputWidth:Re,selected:pe,inputLength:Ae,filteredOptionsCount:qe,visible:rt,softFocus:Ye,selectedLabel:Se,hoverIndex:ke,query:ie,inputHovering:Y,currentPlaceholder:re,menuVisibleOnFocus:Ce,isOnComposition:Pe,isSilentBlur:ot,options:we,resetInputHeight:_,managePlaceholder:k,showClose:$,selectDisabled:M,iconComponent:O,iconReverse:P,showNewOption:A,emptyText:V,toggleLastOptionHitState:B,resetInputState:D,handleComposition:H,handleMenuEnter:T,handleFocus:L,blur:R,handleBlur:U,handleClearClick:ne,handleClose:j,handleKeydownEscape:Q,toggleMenu:he,selectOption:ee,getValueKey:Z,navigateOptions:te,dropMenuVisible:X,focus:Le,reference:le,input:de,iOSInput:Ie,tooltipRef:K,popperPaneRef:Ue,tags:J,selectWrapper:fe,scrollbar:ge,wrapperKls:Tt,selectTagsStyle:tn,nsSelect:n,tagTextStyle:$e,handleMouseEnter:Te,handleMouseLeave:be,showTagList:Ee,collapseTagList:_e}}}),Ij=["disabled","autocomplete"],Pj=["disabled"],Rj={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};function Aj(e,t,n,o,r,l){const s=Qe("el-tag"),a=Qe("el-tooltip"),u=Qe("el-icon"),c=Qe("el-input"),d=Qe("el-option"),f=Qe("el-options"),p=Qe("el-scrollbar"),v=Qe("el-select-menu"),m=ca("click-outside");return et((S(),x("div",{ref:"selectWrapper",class:E(e.wrapperKls),onMouseenter:t[21]||(t[21]=(...h)=>e.handleMouseEnter&&e.handleMouseEnter(...h)),onMouseleave:t[22]||(t[22]=(...h)=>e.handleMouseLeave&&e.handleMouseLeave(...h)),onClick:t[23]||(t[23]=Ge((...h)=>e.toggleMenu&&e.toggleMenu(...h),["stop"]))},[z(a,{ref:"tooltipRef",visible:e.dropMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:q(()=>[I("div",{class:"select-trigger",onMouseenter:t[19]||(t[19]=h=>e.inputHovering=!0),onMouseleave:t[20]||(t[20]=h=>e.inputHovering=!1)},[e.multiple?(S(),x("div",{key:0,ref:"tags",class:E([e.nsSelect.e("tags"),e.nsSelect.is("disabled",e.selectDisabled)]),style:He(e.selectTagsStyle)},[e.collapseTags&&e.selected.length?(S(),ae(Yt,{key:0,onAfterLeave:e.resetInputHeight},{default:q(()=>[I("span",{class:E([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[(S(!0),x(xe,null,lt(e.showTagList,h=>(S(),ae(s,{key:e.getValueKey(h),closable:!e.selectDisabled&&!h.isDisabled,size:e.collapseTagSize,hit:h.hitState,type:e.tagType,"disable-transitions":"",onClose:g=>e.deleteTag(g,h)},{default:q(()=>[I("span",{class:E(e.nsSelect.e("tags-text")),style:He(e.tagTextStyle)},ue(h.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128)),e.selected.length>e.maxCollapseTags?(S(),ae(s,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:q(()=>[e.collapseTagsTooltip?(S(),ae(a,{key:0,disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:q(()=>[I("span",{class:E(e.nsSelect.e("tags-text"))},"+ "+ue(e.selected.length-e.maxCollapseTags),3)]),content:q(()=>[I("div",{class:E(e.nsSelect.e("collapse-tags"))},[(S(!0),x(xe,null,lt(e.collapseTagList,h=>(S(),x("div",{key:e.getValueKey(h),class:E(e.nsSelect.e("collapse-tag"))},[z(s,{class:"in-tooltip",closable:!e.selectDisabled&&!h.isDisabled,size:e.collapseTagSize,hit:h.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:g=>e.deleteTag(g,h)},{default:q(()=>[I("span",{class:E(e.nsSelect.e("tags-text")),style:He({maxWidth:e.inputWidth-75+"px"})},ue(h.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect","teleported"])):(S(),x("span",{key:1,class:E(e.nsSelect.e("tags-text"))},"+ "+ue(e.selected.length-e.maxCollapseTags),3))]),_:1},8,["size","type"])):oe("v-if",!0)],2)]),_:1},8,["onAfterLeave"])):oe("v-if",!0),e.collapseTags?oe("v-if",!0):(S(),ae(Yt,{key:1,onAfterLeave:e.resetInputHeight},{default:q(()=>[I("span",{class:E([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[(S(!0),x(xe,null,lt(e.selected,h=>(S(),ae(s,{key:e.getValueKey(h),closable:!e.selectDisabled&&!h.isDisabled,size:e.collapseTagSize,hit:h.hitState,type:e.tagType,"disable-transitions":"",onClose:g=>e.deleteTag(g,h)},{default:q(()=>[I("span",{class:E(e.nsSelect.e("tags-text")),style:He({maxWidth:e.inputWidth-75+"px"})},ue(h.currentLabel),7)]),_:2},1032,["closable","size","hit","type","onClose"]))),128))],2)]),_:1},8,["onAfterLeave"])),e.filterable?et((S(),x("input",{key:2,ref:"input","onUpdate:modelValue":t[0]||(t[0]=h=>e.query=h),type:"text",class:E([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize),e.nsSelect.is("disabled",e.selectDisabled)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:He({marginLeft:e.prefixWidth&&!e.selected.length||e.tagInMultiLine?`${e.prefixWidth}px`:"",flexGrow:1,width:`${e.inputLength/(e.inputWidth-32)}%`,maxWidth:`${e.inputWidth-42}px`}),onFocus:t[1]||(t[1]=(...h)=>e.handleFocus&&e.handleFocus(...h)),onBlur:t[2]||(t[2]=(...h)=>e.handleBlur&&e.handleBlur(...h)),onKeyup:t[3]||(t[3]=(...h)=>e.managePlaceholder&&e.managePlaceholder(...h)),onKeydown:[t[4]||(t[4]=(...h)=>e.resetInputState&&e.resetInputState(...h)),t[5]||(t[5]=wt(Ge(h=>e.navigateOptions("next"),["prevent"]),["down"])),t[6]||(t[6]=wt(Ge(h=>e.navigateOptions("prev"),["prevent"]),["up"])),t[7]||(t[7]=wt((...h)=>e.handleKeydownEscape&&e.handleKeydownEscape(...h),["esc"])),t[8]||(t[8]=wt(Ge((...h)=>e.selectOption&&e.selectOption(...h),["stop","prevent"]),["enter"])),t[9]||(t[9]=wt((...h)=>e.deletePrevTag&&e.deletePrevTag(...h),["delete"])),t[10]||(t[10]=wt(h=>e.visible=!1,["tab"]))],onCompositionstart:t[11]||(t[11]=(...h)=>e.handleComposition&&e.handleComposition(...h)),onCompositionupdate:t[12]||(t[12]=(...h)=>e.handleComposition&&e.handleComposition(...h)),onCompositionend:t[13]||(t[13]=(...h)=>e.handleComposition&&e.handleComposition(...h)),onInput:t[14]||(t[14]=(...h)=>e.debouncedQueryChange&&e.debouncedQueryChange(...h))},null,46,Ij)),[[Ka,e.query]]):oe("v-if",!0)],6)):oe("v-if",!0),oe(" fix: https://github.com/element-plus/element-plus/issues/11415 "),e.isIOS&&!e.multiple&&e.filterable&&e.readonly?(S(),x("input",{key:1,ref:"iOSInput",class:E([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize),e.nsSelect.em("input","iOS")]),disabled:e.selectDisabled,type:"text"},null,10,Pj)):oe("v-if",!0),z(c,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[15]||(t[15]=h=>e.selectedLabel=h),type:"text",placeholder:typeof e.currentPlaceholder=="function"?e.currentPlaceholder():e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:E([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[16]||(t[16]=wt(Ge(h=>e.navigateOptions("next"),["stop","prevent"]),["down"])),t[17]||(t[17]=wt(Ge(h=>e.navigateOptions("prev"),["stop","prevent"]),["up"])),wt(Ge(e.selectOption,["stop","prevent"]),["enter"]),wt(e.handleKeydownEscape,["esc"]),t[18]||(t[18]=wt(h=>e.visible=!1,["tab"]))]},Xo({suffix:q(()=>[e.iconComponent&&!e.showClose?(S(),ae(u,{key:0,class:E([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:q(()=>[(S(),ae(vt(e.iconComponent)))]),_:1},8,["class"])):oe("v-if",!0),e.showClose&&e.clearIcon?(S(),ae(u,{key:1,class:E([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:q(()=>[(S(),ae(vt(e.clearIcon)))]),_:1},8,["class","onClick"])):oe("v-if",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:q(()=>[I("div",Rj,[ve(e.$slots,"prefix")])])}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])],32)]),content:q(()=>[z(v,null,{default:q(()=>[et(z(p,{ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:E([e.nsSelect.is("empty",!e.allowCreate&&!!e.query&&e.filteredOptionsCount===0)])},{default:q(()=>[e.showNewOption?(S(),ae(d,{key:0,value:e.query,created:!0},null,8,["value"])):oe("v-if",!0),z(f,{onUpdateOptions:e.onOptionsRendered},{default:q(()=>[ve(e.$slots,"default")]),_:3},8,["onUpdateOptions"])]),_:3},8,["wrap-class","view-class","class"]),[[kt,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&e.options.size===0)?(S(),x(xe,{key:0},[e.$slots.empty?ve(e.$slots,"empty",{key:0}):(S(),x("p",{key:1,class:E(e.nsSelect.be("dropdown","empty"))},ue(e.emptyText),3))],64)):oe("v-if",!0)]),_:3})]),_:3},8,["visible","placement","teleported","popper-class","popper-options","effect","transition","persistent","onShow"])],34)),[[m,e.handleClose,e.popperPaneRef]])}var xj=Ne(Mj,[["render",Aj],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);const Lj=G({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},setup(e){const t=ye("select"),n=N(!0),o=ut(),r=N([]);ht(q2,yt({...Qt(e)}));const l=De(ti);tt(()=>{r.value=s(o.subTree)});const s=u=>{const c=[];return Array.isArray(u.children)&&u.children.forEach(d=>{var f;d.type&&d.type.name==="ElOption"&&d.component&&d.component.proxy?c.push(d.component.proxy):(f=d.children)!=null&&f.length&&c.push(...s(d))}),c},{groupQueryChange:a}=Et(l);return me(a,()=>{n.value=r.value.some(u=>u.visible===!0)},{flush:"post"}),{visible:n,ns:t}}});function Dj(e,t,n,o,r,l){return et((S(),x("ul",{class:E(e.ns.be("group","wrap"))},[I("li",{class:E(e.ns.be("group","title"))},ue(e.label),3),I("li",null,[I("ul",{class:E(e.ns.b("group"))},[ve(e.$slots,"default")],2)])],2)),[[kt,e.visible]])}var Y2=Ne(Lj,[["render",Dj],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);const vl=it(xj,{Option:Eh,OptionGroup:Y2}),Ou=jt(Eh),Bj=jt(Y2),Th=()=>De(U2,{}),Fj=Me({pageSize:{type:Number,required:!0},pageSizes:{type:se(Array),default:()=>Ft([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,size:{type:String,values:Lo}}),Vj=G({name:"ElPaginationSizes"}),zj=G({...Vj,props:Fj,emits:["page-size-change"],setup(e,{emit:t}){const n=e,{t:o}=Ct(),r=ye("pagination"),l=Th(),s=N(n.pageSize);me(()=>n.pageSizes,(c,d)=>{if(!jn(c,d)&&Array.isArray(c)){const f=c.includes(n.pageSize)?n.pageSize:n.pageSizes[0];t("page-size-change",f)}}),me(()=>n.pageSize,c=>{s.value=c});const a=C(()=>n.pageSizes);function u(c){var d;c!==s.value&&(s.value=c,(d=l.handleSizeChange)==null||d.call(l,Number(c)))}return(c,d)=>(S(),x("span",{class:E(i(r).e("sizes"))},[z(i(vl),{"model-value":s.value,disabled:c.disabled,"popper-class":c.popperClass,size:c.size,"validate-event":!1,onChange:u},{default:q(()=>[(S(!0),x(xe,null,lt(i(a),f=>(S(),ae(i(Ou),{key:f,value:f,label:f+i(o)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size"])],2))}});var Hj=Ne(zj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/sizes.vue"]]);const Kj=Me({size:{type:String,values:Lo}}),jj=["disabled"],Wj=G({name:"ElPaginationJumper"}),Uj=G({...Wj,props:Kj,setup(e){const{t}=Ct(),n=ye("pagination"),{pageCount:o,disabled:r,currentPage:l,changeEvent:s}=Th(),a=N(),u=C(()=>{var f;return(f=a.value)!=null?f:l==null?void 0:l.value});function c(f){a.value=f?+f:""}function d(f){f=Math.trunc(+f),s==null||s(f),a.value=void 0}return(f,p)=>(S(),x("span",{class:E(i(n).e("jump")),disabled:i(r)},[I("span",{class:E([i(n).e("goto")])},ue(i(t)("el.pagination.goto")),3),z(i(mn),{size:f.size,class:E([i(n).e("editor"),i(n).is("in-pagination")]),min:1,max:i(o),disabled:i(r),"model-value":i(u),"validate-event":!1,label:i(t)("el.pagination.page"),type:"number","onUpdate:modelValue":c,onChange:d},null,8,["size","class","max","disabled","model-value","label"]),I("span",{class:E([i(n).e("classifier")])},ue(i(t)("el.pagination.pageClassifier")),3)],10,jj))}});var qj=Ne(Uj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/jumper.vue"]]);const Yj=Me({total:{type:Number,default:1e3}}),Gj=["disabled"],Xj=G({name:"ElPaginationTotal"}),Jj=G({...Xj,props:Yj,setup(e){const{t}=Ct(),n=ye("pagination"),{disabled:o}=Th();return(r,l)=>(S(),x("span",{class:E(i(n).e("total")),disabled:i(o)},ue(i(t)("el.pagination.total",{total:r.total})),11,Gj))}});var Zj=Ne(Jj,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/total.vue"]]);const Qj=Me({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),eW=["onKeyup"],tW=["aria-current","aria-label","tabindex"],nW=["tabindex","aria-label"],oW=["aria-current","aria-label","tabindex"],rW=["tabindex","aria-label"],lW=["aria-current","aria-label","tabindex"],sW=G({name:"ElPaginationPager"}),aW=G({...sW,props:Qj,emits:["change"],setup(e,{emit:t}){const n=e,o=ye("pager"),r=ye("icon"),{t:l}=Ct(),s=N(!1),a=N(!1),u=N(!1),c=N(!1),d=N(!1),f=N(!1),p=C(()=>{const w=n.pagerCount,b=(w-1)/2,_=Number(n.currentPage),k=Number(n.pageCount);let $=!1,M=!1;k>w&&(_>w-b&&($=!0),_n.disabled?-1:0);Kn(()=>{const w=(n.pagerCount-1)/2;s.value=!1,a.value=!1,n.pageCount>n.pagerCount&&(n.currentPage>n.pagerCount-w&&(s.value=!0),n.currentPagek&&(_=k)),_!==$&&t("change",_)}return(w,b)=>(S(),x("ul",{class:E(i(o).b()),onClick:y,onKeyup:wt(g,["enter"])},[w.pageCount>0?(S(),x("li",{key:0,class:E([[i(o).is("active",w.currentPage===1),i(o).is("disabled",w.disabled)],"number"]),"aria-current":w.currentPage===1,"aria-label":i(l)("el.pagination.currentPage",{pager:1}),tabindex:i(v)}," 1 ",10,tW)):oe("v-if",!0),s.value?(S(),x("li",{key:1,class:E(["more","btn-quickprev",i(r).b(),i(o).is("disabled",w.disabled)]),tabindex:i(v),"aria-label":i(l)("el.pagination.prevPages",{pager:w.pagerCount-2}),onMouseenter:b[0]||(b[0]=_=>m(!0)),onMouseleave:b[1]||(b[1]=_=>u.value=!1),onFocus:b[2]||(b[2]=_=>h(!0)),onBlur:b[3]||(b[3]=_=>d.value=!1)},[(u.value||d.value)&&!w.disabled?(S(),ae(i(os),{key:0})):(S(),ae(i(Bd),{key:1}))],42,nW)):oe("v-if",!0),(S(!0),x(xe,null,lt(i(p),_=>(S(),x("li",{key:_,class:E([[i(o).is("active",w.currentPage===_),i(o).is("disabled",w.disabled)],"number"]),"aria-current":w.currentPage===_,"aria-label":i(l)("el.pagination.currentPage",{pager:_}),tabindex:i(v)},ue(_),11,oW))),128)),a.value?(S(),x("li",{key:2,class:E(["more","btn-quicknext",i(r).b(),i(o).is("disabled",w.disabled)]),tabindex:i(v),"aria-label":i(l)("el.pagination.nextPages",{pager:w.pagerCount-2}),onMouseenter:b[4]||(b[4]=_=>m()),onMouseleave:b[5]||(b[5]=_=>c.value=!1),onFocus:b[6]||(b[6]=_=>h()),onBlur:b[7]||(b[7]=_=>f.value=!1)},[(c.value||f.value)&&!w.disabled?(S(),ae(i(rs),{key:0})):(S(),ae(i(Bd),{key:1}))],42,rW)):oe("v-if",!0),w.pageCount>1?(S(),x("li",{key:3,class:E([[i(o).is("active",w.currentPage===w.pageCount),i(o).is("disabled",w.disabled)],"number"]),"aria-current":w.currentPage===w.pageCount,"aria-label":i(l)("el.pagination.currentPage",{pager:w.pageCount}),tabindex:i(v)},ue(w.pageCount),11,lW)):oe("v-if",!0)],42,eW))}});var iW=Ne(aW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/pagination/src/components/pager.vue"]]);const yn=e=>typeof e!="number",uW=Me({total:Number,pageSize:Number,defaultPageSize:Number,currentPage:Number,defaultCurrentPage:Number,pageCount:Number,pagerCount:{type:Number,validator:e=>Xe(e)&&Math.trunc(e)===e&&e>4&&e<22&&e%2===1,default:7},layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:se(Array),default:()=>Ft([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:Rt,default:()=>Tr},nextText:{type:String,default:""},nextIcon:{type:Rt,default:()=>_n},small:Boolean,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean}),cW={"update:current-page":e=>Xe(e),"update:page-size":e=>Xe(e),"size-change":e=>Xe(e),"current-change":e=>Xe(e),"prev-click":e=>Xe(e),"next-click":e=>Xe(e)},Gg="ElPagination";var dW=G({name:Gg,props:uW,emits:cW,setup(e,{emit:t,slots:n}){const{t:o}=Ct(),r=ye("pagination"),l=ut().vnode.props||{},s="onUpdate:currentPage"in l||"onUpdate:current-page"in l||"onCurrentChange"in l,a="onUpdate:pageSize"in l||"onUpdate:page-size"in l||"onSizeChange"in l,u=C(()=>{if(yn(e.total)&&yn(e.pageCount)||!yn(e.currentPage)&&!s)return!1;if(e.layout.includes("sizes")){if(yn(e.pageCount)){if(!yn(e.total)&&!yn(e.pageSize)&&!a)return!1}else if(!a)return!1}return!0}),c=N(yn(e.defaultPageSize)?10:e.defaultPageSize),d=N(yn(e.defaultCurrentPage)?1:e.defaultCurrentPage),f=C({get(){return yn(e.pageSize)?c.value:e.pageSize},set(b){yn(e.pageSize)&&(c.value=b),a&&(t("update:page-size",b),t("size-change",b))}}),p=C(()=>{let b=0;return yn(e.pageCount)?yn(e.total)||(b=Math.max(1,Math.ceil(e.total/f.value))):b=e.pageCount,b}),v=C({get(){return yn(e.currentPage)?d.value:e.currentPage},set(b){let _=b;b<1?_=1:b>p.value&&(_=p.value),yn(e.currentPage)&&(d.value=_),s&&(t("update:current-page",_),t("current-change",_))}});me(p,b=>{v.value>b&&(v.value=b)});function m(b){v.value=b}function h(b){f.value=b;const _=p.value;v.value>_&&(v.value=_)}function g(){e.disabled||(v.value-=1,t("prev-click",v.value))}function y(){e.disabled||(v.value+=1,t("next-click",v.value))}function w(b,_){b&&(b.props||(b.props={}),b.props.class=[b.props.class,_].join(" "))}return ht(U2,{pageCount:p,disabled:C(()=>e.disabled),currentPage:v,changeEvent:m,handleSizeChange:h}),()=>{var b,_;if(!u.value)return o("el.pagination.deprecationWarning"),null;if(!e.layout||e.hideOnSinglePage&&p.value<=1)return null;const k=[],$=[],M=je("div",{class:r.e("rightwrapper")},$),O={prev:je(hj,{disabled:e.disabled,currentPage:v.value,prevText:e.prevText,prevIcon:e.prevIcon,onClick:g}),jumper:je(qj,{size:e.small?"small":"default"}),pager:je(iW,{currentPage:v.value,pageCount:p.value,pagerCount:e.pagerCount,onChange:m,disabled:e.disabled}),next:je(wj,{disabled:e.disabled,currentPage:v.value,pageCount:p.value,nextText:e.nextText,nextIcon:e.nextIcon,onClick:y}),sizes:je(Hj,{pageSize:f.value,pageSizes:e.pageSizes,popperClass:e.popperClass,disabled:e.disabled,size:e.small?"small":"default"}),slot:(_=(b=n==null?void 0:n.default)==null?void 0:b.call(n))!=null?_:null,total:je(Zj,{total:yn(e.total)?0:e.total})},P=e.layout.split(",").map(V=>V.trim());let A=!1;return P.forEach(V=>{if(V==="->"){A=!0;return}A?$.push(O[V]):k.push(O[V])}),w(k[0],r.is("first")),w(k[k.length-1],r.is("last")),A&&$.length>0&&(w($[0],r.is("first")),w($[$.length-1],r.is("last")),k.push(M)),je("div",{class:[r.b(),r.is("background",e.background),{[r.m("small")]:e.small}]},k)}}});const Oh=it(dW),fW=Me({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:Gd,default:"primary"},cancelButtonType:{type:String,values:Gd,default:"text"},icon:{type:Rt,default:()=>SR},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},teleported:sn.teleported,persistent:sn.persistent,width:{type:[String,Number],default:150}}),pW={confirm:e=>e instanceof MouseEvent,cancel:e=>e instanceof MouseEvent},hW=G({name:"ElPopconfirm"}),vW=G({...hW,props:fW,emits:pW,setup(e,{emit:t}){const n=e,{t:o}=Ct(),r=ye("popconfirm"),l=N(),s=()=>{var p,v;(v=(p=l.value)==null?void 0:p.onClose)==null||v.call(p)},a=C(()=>({width:qt(n.width)})),u=p=>{t("confirm",p),s()},c=p=>{t("cancel",p),s()},d=C(()=>n.confirmButtonText||o("el.popconfirm.confirmButtonText")),f=C(()=>n.cancelButtonText||o("el.popconfirm.cancelButtonText"));return(p,v)=>(S(),ae(i(En),pt({ref_key:"tooltipRef",ref:l,trigger:"click",effect:"light"},p.$attrs,{"popper-class":`${i(r).namespace.value}-popover`,"popper-style":i(a),teleported:p.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":p.hideAfter,persistent:p.persistent}),{content:q(()=>[I("div",{class:E(i(r).b())},[I("div",{class:E(i(r).e("main"))},[!p.hideIcon&&p.icon?(S(),ae(i(ze),{key:0,class:E(i(r).e("icon")),style:He({color:p.iconColor})},{default:q(()=>[(S(),ae(vt(p.icon)))]),_:1},8,["class","style"])):oe("v-if",!0),nt(" "+ue(p.title),1)],2),I("div",{class:E(i(r).e("action"))},[z(i(Zt),{size:"small",type:p.cancelButtonType==="text"?"":p.cancelButtonType,text:p.cancelButtonType==="text",onClick:c},{default:q(()=>[nt(ue(i(f)),1)]),_:1},8,["type","text"]),z(i(Zt),{size:"small",type:p.confirmButtonType==="text"?"":p.confirmButtonType,text:p.confirmButtonType==="text",onClick:u},{default:q(()=>[nt(ue(i(d)),1)]),_:1},8,["type","text"])],2)],2)]),default:q(()=>[p.$slots.reference?ve(p.$slots,"reference",{key:0}):oe("v-if",!0)]),_:3},16,["popper-class","popper-style","teleported","hide-after","persistent"]))}});var mW=Ne(vW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popconfirm/src/popconfirm.vue"]]);const gW=it(mW),yW=Me({trigger:Ea.trigger,placement:Zi.placement,disabled:Ea.disabled,visible:sn.visible,transition:sn.transition,popperOptions:Zi.popperOptions,tabindex:Zi.tabindex,content:sn.content,popperStyle:sn.popperStyle,popperClass:sn.popperClass,enterable:{...sn.enterable,default:!0},effect:{...sn.effect,default:"light"},teleported:sn.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),bW={"update:visible":e=>Xt(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},wW="onUpdate:visible",_W=G({name:"ElPopover"}),CW=G({..._W,props:yW,emits:bW,setup(e,{expose:t,emit:n}){const o=e,r=C(()=>o[wW]),l=ye("popover"),s=N(),a=C(()=>{var g;return(g=i(s))==null?void 0:g.popperRef}),u=C(()=>[{width:qt(o.width)},o.popperStyle]),c=C(()=>[l.b(),o.popperClass,{[l.m("plain")]:!!o.content}]),d=C(()=>o.transition===`${l.namespace.value}-fade-in-linear`),f=()=>{var g;(g=s.value)==null||g.hide()},p=()=>{n("before-enter")},v=()=>{n("before-leave")},m=()=>{n("after-enter")},h=()=>{n("update:visible",!1),n("after-leave")};return t({popperRef:a,hide:f}),(g,y)=>(S(),ae(i(En),pt({ref_key:"tooltipRef",ref:s},g.$attrs,{trigger:g.trigger,placement:g.placement,disabled:g.disabled,visible:g.visible,transition:g.transition,"popper-options":g.popperOptions,tabindex:g.tabindex,content:g.content,offset:g.offset,"show-after":g.showAfter,"hide-after":g.hideAfter,"auto-close":g.autoClose,"show-arrow":g.showArrow,"aria-label":g.title,effect:g.effect,enterable:g.enterable,"popper-class":i(c),"popper-style":i(u),teleported:g.teleported,persistent:g.persistent,"gpu-acceleration":i(d),"onUpdate:visible":i(r),onBeforeShow:p,onBeforeHide:v,onShow:m,onHide:h}),{content:q(()=>[g.title?(S(),x("div",{key:0,class:E(i(l).e("title")),role:"title"},ue(g.title),3)):oe("v-if",!0),ve(g.$slots,"default",{},()=>[nt(ue(g.content),1)])]),default:q(()=>[g.$slots.reference?ve(g.$slots,"reference",{key:0}):oe("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var SW=Ne(CW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popover/src/popover.vue"]]);const Xg=(e,t)=>{const n=t.arg||t.value,o=n==null?void 0:n.popperRef;o&&(o.triggerRef=e)};var kW={mounted(e,t){Xg(e,t)},updated(e,t){Xg(e,t)}};const $W="popover",G2=XA(kW,$W),EW=it(SW,{directive:G2}),TW=Me({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:{type:Boolean,default:!1},duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:se(String),default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:se([String,Array,Function]),default:""},format:{type:se(Function),default:e=>`${e}%`}}),OW=["aria-valuenow"],NW={viewBox:"0 0 100 100"},MW=["d","stroke","stroke-width"],IW=["d","stroke","opacity","stroke-linecap","stroke-width"],PW={key:0},RW=G({name:"ElProgress"}),AW=G({...RW,props:TW,setup(e){const t=e,n={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},o=ye("progress"),r=C(()=>({width:`${t.percentage}%`,animationDuration:`${t.duration}s`,backgroundColor:w(t.percentage)})),l=C(()=>(t.strokeWidth/t.width*100).toFixed(1)),s=C(()=>["circle","dashboard"].includes(t.type)?Number.parseInt(`${50-Number.parseFloat(l.value)/2}`,10):0),a=C(()=>{const b=s.value,_=t.type==="dashboard";return`
+ M 50 50
+ m 0 ${_?"":"-"}${b}
+ a ${b} ${b} 0 1 1 0 ${_?"-":""}${b*2}
+ a ${b} ${b} 0 1 1 0 ${_?"":"-"}${b*2}
+ `}),u=C(()=>2*Math.PI*s.value),c=C(()=>t.type==="dashboard"?.75:1),d=C(()=>`${-1*u.value*(1-c.value)/2}px`),f=C(()=>({strokeDasharray:`${u.value*c.value}px, ${u.value}px`,strokeDashoffset:d.value})),p=C(()=>({strokeDasharray:`${u.value*c.value*(t.percentage/100)}px, ${u.value}px`,strokeDashoffset:d.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),v=C(()=>{let b;return t.color?b=w(t.percentage):b=n[t.status]||n.default,b}),m=C(()=>t.status==="warning"?ac:t.type==="line"?t.status==="success"?jp:Lr:t.status==="success"?Ja:vo),h=C(()=>t.type==="line"?12+t.strokeWidth*.4:t.width*.111111+2),g=C(()=>t.format(t.percentage));function y(b){const _=100/b.length;return b.map(($,M)=>Ze($)?{color:$,percentage:(M+1)*_}:$).sort(($,M)=>$.percentage-M.percentage)}const w=b=>{var _;const{color:k}=t;if(Je(k))return k(b);if(Ze(k))return k;{const $=y(k);for(const M of $)if(M.percentage>b)return M.color;return(_=$[$.length-1])==null?void 0:_.color}};return(b,_)=>(S(),x("div",{class:E([i(o).b(),i(o).m(b.type),i(o).is(b.status),{[i(o).m("without-text")]:!b.showText,[i(o).m("text-inside")]:b.textInside}]),role:"progressbar","aria-valuenow":b.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[b.type==="line"?(S(),x("div",{key:0,class:E(i(o).b("bar"))},[I("div",{class:E(i(o).be("bar","outer")),style:He({height:`${b.strokeWidth}px`})},[I("div",{class:E([i(o).be("bar","inner"),{[i(o).bem("bar","inner","indeterminate")]:b.indeterminate}]),style:He(i(r))},[(b.showText||b.$slots.default)&&b.textInside?(S(),x("div",{key:0,class:E(i(o).be("bar","innerText"))},[ve(b.$slots,"default",{percentage:b.percentage},()=>[I("span",null,ue(i(g)),1)])],2)):oe("v-if",!0)],6)],6)],2)):(S(),x("div",{key:1,class:E(i(o).b("circle")),style:He({height:`${b.width}px`,width:`${b.width}px`})},[(S(),x("svg",NW,[I("path",{class:E(i(o).be("circle","track")),d:i(a),stroke:`var(${i(o).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-width":i(l),fill:"none",style:He(i(f))},null,14,MW),I("path",{class:E(i(o).be("circle","path")),d:i(a),stroke:i(v),fill:"none",opacity:b.percentage?1:0,"stroke-linecap":b.strokeLinecap,"stroke-width":i(l),style:He(i(p))},null,14,IW)]))],6)),(b.showText||b.$slots.default)&&!b.textInside?(S(),x("div",{key:2,class:E(i(o).e("text")),style:He({fontSize:`${i(h)}px`})},[ve(b.$slots,"default",{percentage:b.percentage},()=>[b.status?(S(),ae(i(ze),{key:1},{default:q(()=>[(S(),ae(vt(i(m))))]),_:1})):(S(),x("span",PW,ue(i(g)),1))])],6)):oe("v-if",!0)],10,OW))}});var xW=Ne(AW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);const X2=it(xW),LW=Me({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:se([Array,Object]),default:()=>Ft(["","",""])},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:se([Array,Object]),default:()=>[gi,gi,gi]},voidIcon:{type:Rt,default:()=>vA},disabledVoidIcon:{type:Rt,default:()=>gi},disabled:Boolean,allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:se(Array),default:()=>Ft(["Extremely bad","Disappointed","Fair","Satisfied","Surprise"])},scoreTemplate:{type:String,default:"{value}"},size:hn,label:{type:String,default:void 0},clearable:{type:Boolean,default:!1}}),DW={[At]:e=>Xe(e),[dt]:e=>Xe(e)},BW=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"],FW=["onMousemove","onClick"],VW=G({name:"ElRate"}),zW=G({...VW,props:LW,emits:DW,setup(e,{expose:t,emit:n}){const o=e;function r(F,T){const L=ne=>ft(ne),R=Object.keys(T).map(ne=>+ne).filter(ne=>{const j=T[ne];return(L(j)?j.excluded:!1)?Fne-j),U=T[R[0]];return L(U)&&U.value||U}const l=De(kl,void 0),s=De(xo,void 0),a=Jt(),u=ye("rate"),{inputId:c,isLabeledByFormItem:d}=Fr(o,{formItemContext:s}),f=N(o.modelValue),p=N(-1),v=N(!0),m=C(()=>[u.b(),u.m(a.value)]),h=C(()=>o.disabled||(l==null?void 0:l.disabled)),g=C(()=>u.cssVarBlock({"void-color":o.voidColor,"disabled-void-color":o.disabledVoidColor,"fill-color":_.value})),y=C(()=>{let F="";return o.showScore?F=o.scoreTemplate.replace(/\{\s*value\s*\}/,h.value?`${o.modelValue}`:`${f.value}`):o.showText&&(F=o.texts[Math.ceil(f.value)-1]),F}),w=C(()=>o.modelValue*100-Math.floor(o.modelValue)*100),b=C(()=>Ve(o.colors)?{[o.lowThreshold]:o.colors[0],[o.highThreshold]:{value:o.colors[1],excluded:!0},[o.max]:o.colors[2]}:o.colors),_=C(()=>{const F=r(f.value,b.value);return ft(F)?"":F}),k=C(()=>{let F="";return h.value?F=`${w.value}%`:o.allowHalf&&(F="50%"),{color:_.value,width:F}}),$=C(()=>{let F=Ve(o.icons)?[...o.icons]:{...o.icons};return F=sl(F),Ve(F)?{[o.lowThreshold]:F[0],[o.highThreshold]:{value:F[1],excluded:!0},[o.max]:F[2]}:F}),M=C(()=>r(o.modelValue,$.value)),O=C(()=>h.value?Ze(o.disabledVoidIcon)?o.disabledVoidIcon:sl(o.disabledVoidIcon):Ze(o.voidIcon)?o.voidIcon:sl(o.voidIcon)),P=C(()=>r(f.value,$.value));function A(F){const T=h.value&&w.value>0&&F-1o.modelValue,L=o.allowHalf&&v.value&&F-.5<=f.value&&F>f.value;return T||L}function V(F){o.clearable&&F===o.modelValue&&(F=0),n(dt,F),o.modelValue!==F&&n("change",F)}function B(F){h.value||(o.allowHalf&&v.value?V(f.value):V(F))}function D(F){if(h.value)return;let T=f.value;const L=F.code;return L===We.up||L===We.right?(o.allowHalf?T+=.5:T+=1,F.stopPropagation(),F.preventDefault()):(L===We.left||L===We.down)&&(o.allowHalf?T-=.5:T-=1,F.stopPropagation(),F.preventDefault()),T=T<0?0:T,T=T>o.max?o.max:T,n(dt,T),n("change",T),T}function H(F,T){if(!h.value){if(o.allowHalf&&T){let L=T.target;po(L,u.e("item"))&&(L=L.querySelector(`.${u.e("icon")}`)),(L.clientWidth===0||po(L,u.e("decimal")))&&(L=L.parentNode),v.value=T.offsetX*2<=L.clientWidth,f.value=v.value?F-.5:F}else f.value=F;p.value=F}}function W(){h.value||(o.allowHalf&&(v.value=o.modelValue!==Math.floor(o.modelValue)),f.value=o.modelValue,p.value=-1)}return me(()=>o.modelValue,F=>{f.value=F,v.value=o.modelValue!==Math.floor(o.modelValue)}),o.modelValue||n(dt,0),t({setCurrentValue:H,resetCurrentValue:W}),(F,T)=>{var L;return S(),x("div",{id:i(c),class:E([i(m),i(u).is("disabled",i(h))]),role:"slider","aria-label":i(d)?void 0:F.label||"rating","aria-labelledby":i(d)?(L=i(s))==null?void 0:L.labelId:void 0,"aria-valuenow":f.value,"aria-valuetext":i(y)||void 0,"aria-valuemin":"0","aria-valuemax":F.max,tabindex:"0",style:He(i(g)),onKeydown:D},[(S(!0),x(xe,null,lt(F.max,(R,U)=>(S(),x("span",{key:U,class:E(i(u).e("item")),onMousemove:ne=>H(R,ne),onMouseleave:W,onClick:ne=>B(R)},[z(i(ze),{class:E([i(u).e("icon"),{hover:p.value===R},i(u).is("active",R<=f.value)])},{default:q(()=>[A(R)?oe("v-if",!0):(S(),x(xe,{key:0},[et((S(),ae(vt(i(P)),null,null,512)),[[kt,R<=f.value]]),et((S(),ae(vt(i(O)),null,null,512)),[[kt,!(R<=f.value)]])],64)),A(R)?(S(),ae(i(ze),{key:1,style:He(i(k)),class:E([i(u).e("icon"),i(u).e("decimal")])},{default:q(()=>[(S(),ae(vt(i(M))))]),_:1},8,["style","class"])):oe("v-if",!0)]),_:2},1032,["class"])],42,FW))),128)),F.showText||F.showScore?(S(),x("span",{key:0,class:E(i(u).e("text"))},ue(i(y)),3)):oe("v-if",!0)],46,BW)}}});var HW=Ne(zW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/rate/src/rate.vue"]]);const KW=it(HW),Ll={success:"icon-success",warning:"icon-warning",error:"icon-error",info:"icon-info"},Jg={[Ll.success]:fI,[Ll.warning]:ac,[Ll.error]:Wp,[Ll.info]:Up},jW=Me({title:{type:String,default:""},subTitle:{type:String,default:""},icon:{type:String,values:["success","warning","info","error"],default:"info"}}),WW=G({name:"ElResult"}),UW=G({...WW,props:jW,setup(e){const t=e,n=ye("result"),o=C(()=>{const r=t.icon,l=r&&Ll[r]?Ll[r]:"icon-info",s=Jg[l]||Jg["icon-info"];return{class:l,component:s}});return(r,l)=>(S(),x("div",{class:E(i(n).b())},[I("div",{class:E(i(n).e("icon"))},[ve(r.$slots,"icon",{},()=>[i(o).component?(S(),ae(vt(i(o).component),{key:0,class:E(i(o).class)},null,8,["class"])):oe("v-if",!0)])],2),r.title||r.$slots.title?(S(),x("div",{key:0,class:E(i(n).e("title"))},[ve(r.$slots,"title",{},()=>[I("p",null,ue(r.title),1)])],2)):oe("v-if",!0),r.subTitle||r.$slots["sub-title"]?(S(),x("div",{key:1,class:E(i(n).e("subtitle"))},[ve(r.$slots,"sub-title",{},()=>[I("p",null,ue(r.subTitle),1)])],2)):oe("v-if",!0),r.$slots.extra?(S(),x("div",{key:2,class:E(i(n).e("extra"))},[ve(r.$slots,"extra")],2)):oe("v-if",!0)],2))}});var qW=Ne(UW,[["__file","/home/runner/work/element-plus/element-plus/packages/components/result/src/result.vue"]]);const YW=it(qW);var Zg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function GW(e,t){return!!(e===t||Zg(e)&&Zg(t))}function XW(e,t){if(e.length!==t.length)return!1;for(var n=0;n{const t=ut().proxy.$props;return C(()=>{const n=(o,r,l)=>({});return t.perfMode?oc(n):JW(n)})},$f=50,Nu="itemRendered",Mu="scroll",Dl="forward",Iu="backward",Gn="auto",kc="smart",Na="start",Oo="center",Ma="end",cs="horizontal",Nh="vertical",ZW="ltr",ql="rtl",Ia="negative",Mh="positive-ascending",Ih="positive-descending",QW={[cs]:"left",[Nh]:"top"},eU=20,tU={[cs]:"deltaX",[Nh]:"deltaY"},nU=({atEndEdge:e,atStartEdge:t,layout:n},o)=>{let r,l=0;const s=u=>u<0&&t.value||u>0&&e.value;return{hasReachedEdge:s,onWheel:u=>{dc(r);const c=u[tU[n.value]];s(l)&&s(l+c)||(l+=c,m1()||u.preventDefault(),r=wa(()=>{o(l),l=0}))}}},Ef=bo({type:se([Number,Function]),required:!0}),Tf=bo({type:Number}),Of=bo({type:Number,default:2}),oU=bo({type:String,values:["ltr","rtl"],default:"ltr"}),Nf=bo({type:Number,default:0}),Pu=bo({type:Number,required:!0}),Z2=bo({type:String,values:["horizontal","vertical"],default:Nh}),Q2=Me({className:{type:String,default:""},containerElement:{type:se([String,Object]),default:"div"},data:{type:se(Array),default:()=>Ft([])},direction:oU,height:{type:[String,Number],required:!0},innerElement:{type:[String,Object],default:"div"},style:{type:se([Object,String,Array])},useIsScrolling:{type:Boolean,default:!1},width:{type:[Number,String],required:!1},perfMode:{type:Boolean,default:!0},scrollbarAlwaysOn:{type:Boolean,default:!1}}),e_=Me({cache:Of,estimatedItemSize:Tf,layout:Z2,initScrollOffset:Nf,total:Pu,itemSize:Ef,...Q2}),Mf={type:Number,default:6},t_={type:Number,default:0},n_={type:Number,default:2},cl=Me({columnCache:Of,columnWidth:Ef,estimatedColumnWidth:Tf,estimatedRowHeight:Tf,initScrollLeft:Nf,initScrollTop:Nf,itemKey:{type:se(Function),default:({columnIndex:e,rowIndex:t})=>`${t}:${e}`},rowCache:Of,rowHeight:Ef,totalColumn:Pu,totalRow:Pu,hScrollbarSize:Mf,vScrollbarSize:Mf,scrollbarStartGap:t_,scrollbarEndGap:n_,role:String,...Q2}),o_=Me({alwaysOn:Boolean,class:String,layout:Z2,total:Pu,ratio:{type:Number,required:!0},clientSize:{type:Number,required:!0},scrollFrom:{type:Number,required:!0},scrollbarSize:Mf,startGap:t_,endGap:n_,visible:Boolean}),nl=(e,t)=>ee===ZW||e===ql||e===cs,Qg=e=>e===ql;let Tl=null;function Ru(e=!1){if(Tl===null||e){const t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";const o=document.createElement("div"),r=o.style;return r.width="100px",r.height="100px",t.appendChild(o),document.body.appendChild(t),t.scrollLeft>0?Tl=Ih:(t.scrollLeft=1,t.scrollLeft===0?Tl=Ia:Tl=Mh),document.body.removeChild(t),Tl}return Tl}function rU({move:e,size:t,bar:n},o){const r={},l=`translate${n.axis}(${e}px)`;return r[n.size]=t,r.transform=l,r.msTransform=l,r.webkitTransform=l,o==="horizontal"?r.height="100%":r.width="100%",r}const If=G({name:"ElVirtualScrollBar",props:o_,emits:["scroll","start-move","stop-move"],setup(e,{emit:t}){const n=C(()=>e.startGap+e.endGap),o=ye("virtual-scrollbar"),r=ye("scrollbar"),l=N(),s=N();let a=null,u=null;const c=yt({isDragging:!1,traveled:0}),d=C(()=>ow[e.layout]),f=C(()=>e.clientSize-i(n)),p=C(()=>({position:"absolute",width:`${cs===e.layout?f.value:e.scrollbarSize}px`,height:`${cs===e.layout?e.scrollbarSize:f.value}px`,[QW[e.layout]]:"2px",right:"2px",bottom:"2px",borderRadius:"4px"})),v=C(()=>{const $=e.ratio,M=e.clientSize;if($>=100)return Number.POSITIVE_INFINITY;if($>=50)return $*M/100;const O=M/3;return Math.floor(Math.min(Math.max($*M,eU),O))}),m=C(()=>{if(!Number.isFinite(v.value))return{display:"none"};const $=`${v.value}px`;return rU({bar:d.value,size:$,move:c.traveled},e.layout)}),h=C(()=>Math.floor(e.clientSize-v.value-i(n))),g=()=>{window.addEventListener("mousemove",_),window.addEventListener("mouseup",b);const $=i(s);$&&(u=document.onselectstart,document.onselectstart=()=>!1,$.addEventListener("touchmove",_),$.addEventListener("touchend",b))},y=()=>{window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",b),document.onselectstart=u,u=null;const $=i(s);$&&($.removeEventListener("touchmove",_),$.removeEventListener("touchend",b))},w=$=>{$.stopImmediatePropagation(),!($.ctrlKey||[1,2].includes($.button))&&(c.isDragging=!0,c[d.value.axis]=$.currentTarget[d.value.offset]-($[d.value.client]-$.currentTarget.getBoundingClientRect()[d.value.direction]),t("start-move"),g())},b=()=>{c.isDragging=!1,c[d.value.axis]=0,t("stop-move"),y()},_=$=>{const{isDragging:M}=c;if(!M||!s.value||!l.value)return;const O=c[d.value.axis];if(!O)return;dc(a);const P=(l.value.getBoundingClientRect()[d.value.direction]-$[d.value.client])*-1,A=s.value[d.value.offset]-O,V=P-A;a=wa(()=>{c.traveled=Math.max(e.startGap,Math.min(V,h.value)),t("scroll",V,h.value)})},k=$=>{const M=Math.abs($.target.getBoundingClientRect()[d.value.direction]-$[d.value.client]),O=s.value[d.value.offset]/2,P=M-O;c.traveled=Math.max(0,Math.min(P,h.value)),t("scroll",P,h.value)};return me(()=>e.scrollFrom,$=>{c.isDragging||(c.traveled=Math.ceil($*h.value))}),Dt(()=>{y()}),()=>je("div",{role:"presentation",ref:l,class:[o.b(),e.class,(e.alwaysOn||c.isDragging)&&"always-on"],style:p.value,onMousedown:Ge(k,["stop","prevent"]),onTouchstartPrevent:w},je("div",{ref:s,class:r.e("thumb"),style:m.value,onMousedown:w},[]))}}),r_=({name:e,getOffset:t,getItemSize:n,getItemOffset:o,getEstimatedTotalSize:r,getStartIndexForOffset:l,getStopIndexForStartIndex:s,initCache:a,clearCache:u,validateProps:c})=>G({name:e??"ElVirtualList",props:e_,emits:[Nu,Mu],setup(d,{emit:f,expose:p}){c(d);const v=ut(),m=ye("vl"),h=N(a(d,v)),g=J2(),y=N(),w=N(),b=N(),_=N({isScrolling:!1,scrollDir:"forward",scrollOffset:Xe(d.initScrollOffset)?d.initScrollOffset:0,updateRequested:!1,isScrollbarDragging:!1,scrollbarAlwaysOn:d.scrollbarAlwaysOn}),k=C(()=>{const{total:Q,cache:he}=d,{isScrolling:ee,scrollDir:Z,scrollOffset:te}=i(_);if(Q===0)return[0,0,0,0];const X=l(d,te,i(h)),le=s(d,X,te,i(h)),de=!ee||Z===Iu?Math.max(1,he):1,Ie=!ee||Z===Dl?Math.max(1,he):1;return[Math.max(0,X-de),Math.max(0,Math.min(Q-1,le+Ie)),X,le]}),$=C(()=>r(d,i(h))),M=C(()=>Pa(d.layout)),O=C(()=>[{position:"relative",[`overflow-${M.value?"x":"y"}`]:"scroll",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:d.direction,height:Xe(d.height)?`${d.height}px`:d.height,width:Xe(d.width)?`${d.width}px`:d.width},d.style]),P=C(()=>{const Q=i($),he=i(M);return{height:he?"100%":`${Q}px`,pointerEvents:i(_).isScrolling?"none":void 0,width:he?`${Q}px`:"100%"}}),A=C(()=>M.value?d.width:d.height),{onWheel:V}=nU({atStartEdge:C(()=>_.value.scrollOffset<=0),atEndEdge:C(()=>_.value.scrollOffset>=$.value),layout:C(()=>d.layout)},Q=>{var he,ee;(ee=(he=b.value).onMouseUp)==null||ee.call(he),T(Math.min(_.value.scrollOffset+Q,$.value-A.value))}),B=()=>{const{total:Q}=d;if(Q>0){const[te,X,le,de]=i(k);f(Nu,te,X,le,de)}const{scrollDir:he,scrollOffset:ee,updateRequested:Z}=i(_);f(Mu,he,ee,Z)},D=Q=>{const{clientHeight:he,scrollHeight:ee,scrollTop:Z}=Q.currentTarget,te=i(_);if(te.scrollOffset===Z)return;const X=Math.max(0,Math.min(Z,ee-he));_.value={...te,isScrolling:!0,scrollDir:nl(te.scrollOffset,X),scrollOffset:X,updateRequested:!1},Ke(U)},H=Q=>{const{clientWidth:he,scrollLeft:ee,scrollWidth:Z}=Q.currentTarget,te=i(_);if(te.scrollOffset===ee)return;const{direction:X}=d;let le=ee;if(X===ql)switch(Ru()){case Ia:{le=-ee;break}case Ih:{le=Z-he-ee;break}}le=Math.max(0,Math.min(le,Z-he)),_.value={...te,isScrolling:!0,scrollDir:nl(te.scrollOffset,le),scrollOffset:le,updateRequested:!1},Ke(U)},W=Q=>{i(M)?H(Q):D(Q),B()},F=(Q,he)=>{const ee=($.value-A.value)/he*Q;T(Math.min($.value-A.value,ee))},T=Q=>{Q=Math.max(Q,0),Q!==i(_).scrollOffset&&(_.value={...i(_),scrollOffset:Q,scrollDir:nl(i(_).scrollOffset,Q),updateRequested:!0},Ke(U))},L=(Q,he=Gn)=>{const{scrollOffset:ee}=i(_);Q=Math.max(0,Math.min(Q,d.total-1)),T(t(d,Q,he,ee,i(h)))},R=Q=>{const{direction:he,itemSize:ee,layout:Z}=d,te=g.value(u&&ee,u&&Z,u&&he);let X;if(gt(te,String(Q)))X=te[Q];else{const le=o(d,Q,i(h)),de=n(d,Q,i(h)),Ie=i(M),K=he===ql,J=Ie?le:0;te[Q]=X={position:"absolute",left:K?void 0:`${J}px`,right:K?`${J}px`:void 0,top:Ie?0:`${le}px`,height:Ie?"100%":`${de}px`,width:Ie?`${de}px`:"100%"}}return X},U=()=>{_.value.isScrolling=!1,Ke(()=>{g.value(-1,null,null)})},ne=()=>{const Q=y.value;Q&&(Q.scrollTop=0)};tt(()=>{if(!bt)return;const{initScrollOffset:Q}=d,he=i(y);Xe(Q)&&he&&(i(M)?he.scrollLeft=Q:he.scrollTop=Q),B()}),er(()=>{const{direction:Q,layout:he}=d,{scrollOffset:ee,updateRequested:Z}=i(_),te=i(y);if(Z&&te)if(he===cs)if(Q===ql)switch(Ru()){case Ia:{te.scrollLeft=-ee;break}case Mh:{te.scrollLeft=ee;break}default:{const{clientWidth:X,scrollWidth:le}=te;te.scrollLeft=le-X-ee;break}}else te.scrollLeft=ee;else te.scrollTop=ee});const j={ns:m,clientSize:A,estimatedTotalSize:$,windowStyle:O,windowRef:y,innerRef:w,innerStyle:P,itemsToRender:k,scrollbarRef:b,states:_,getItemStyle:R,onScroll:W,onScrollbarScroll:F,onWheel:V,scrollTo:T,scrollToItem:L,resetScrollTop:ne};return p({windowRef:y,innerRef:w,getItemStyleCache:g,scrollTo:T,scrollToItem:L,resetScrollTop:ne,states:_}),j},render(d){var f;const{$slots:p,className:v,clientSize:m,containerElement:h,data:g,getItemStyle:y,innerElement:w,itemsToRender:b,innerStyle:_,layout:k,total:$,onScroll:M,onScrollbarScroll:O,onWheel:P,states:A,useIsScrolling:V,windowStyle:B,ns:D}=d,[H,W]=b,F=vt(h),T=vt(w),L=[];if($>0)for(let j=H;j<=W;j++)L.push((f=p.default)==null?void 0:f.call(p,{data:g,key:j,index:j,isScrolling:V?A.isScrolling:void 0,style:y(j)}));const R=[je(T,{style:_,ref:"innerRef"},Ze(T)?L:{default:()=>L})],U=je(If,{ref:"scrollbarRef",clientSize:m,layout:k,onScroll:O,ratio:m*100/this.estimatedTotalSize,scrollFrom:A.scrollOffset/(this.estimatedTotalSize-m),total:$}),ne=je(F,{class:[D.e("window"),v],style:B,onScroll:M,onWheel:P,ref:"windowRef",key:0},Ze(F)?[R]:{default:()=>[R]});return je("div",{key:0,class:[D.e("wrapper"),A.scrollbarAlwaysOn?"always-on":""]},[ne,U])}}),l_=r_({name:"ElFixedSizeList",getItemOffset:({itemSize:e},t)=>t*e,getItemSize:({itemSize:e})=>e,getEstimatedTotalSize:({total:e,itemSize:t})=>t*e,getOffset:({height:e,total:t,itemSize:n,layout:o,width:r},l,s,a)=>{const u=Pa(o)?r:e,c=Math.max(0,t*n-u),d=Math.min(c,l*n),f=Math.max(0,(l+1)*n-u);switch(s===kc&&(a>=f-u&&a<=d+u?s=Gn:s=Oo),s){case Na:return d;case Ma:return f;case Oo:{const p=Math.round(f+(d-f)/2);return pc+Math.floor(u/2)?c:p}case Gn:default:return a>=f&&a<=d?a:aMath.max(0,Math.min(e-1,Math.floor(n/t))),getStopIndexForStartIndex:({height:e,total:t,itemSize:n,layout:o,width:r},l,s)=>{const a=l*n,u=Pa(o)?r:e,c=Math.ceil((u+s-a)/n);return Math.max(0,Math.min(t-1,l+c-1))},initCache(){},clearCache:!0,validateProps(){}}),Bl=(e,t,n)=>{const{itemSize:o}=e,{items:r,lastVisitedIndex:l}=n;if(t>l){let s=0;if(l>=0){const a=r[l];s=a.offset+a.size}for(let a=l+1;a<=t;a++){const u=o(a);r[a]={offset:s,size:u},s+=u}n.lastVisitedIndex=t}return r[t]},lU=(e,t,n)=>{const{items:o,lastVisitedIndex:r}=t;return(r>0?o[r].offset:0)>=n?s_(e,t,0,r,n):sU(e,t,Math.max(0,r),n)},s_=(e,t,n,o,r)=>{for(;n<=o;){const l=n+Math.floor((o-n)/2),s=Bl(e,l,t).offset;if(s===r)return l;sr&&(o=l-1)}return Math.max(0,n-1)},sU=(e,t,n,o)=>{const{total:r}=e;let l=1;for(;n{let r=0;if(o>=e&&(o=e-1),o>=0){const a=t[o];r=a.offset+a.size}const s=(e-o-1)*n;return r+s},aU=r_({name:"ElDynamicSizeList",getItemOffset:(e,t,n)=>Bl(e,t,n).offset,getItemSize:(e,t,{items:n})=>n[t].size,getEstimatedTotalSize:ey,getOffset:(e,t,n,o,r)=>{const{height:l,layout:s,width:a}=e,u=Pa(s)?a:l,c=Bl(e,t,r),d=ey(e,r),f=Math.max(0,Math.min(d-u,c.offset)),p=Math.max(0,c.offset-u+c.size);switch(n===kc&&(o>=p-u&&o<=f+u?n=Gn:n=Oo),n){case Na:return f;case Ma:return p;case Oo:return Math.round(p+(f-p)/2);case Gn:default:return o>=p&&o<=f?o:olU(e,n,t),getStopIndexForStartIndex:(e,t,n,o)=>{const{height:r,total:l,layout:s,width:a}=e,u=Pa(s)?a:r,c=Bl(e,t,o),d=n+u;let f=c.offset+c.size,p=t;for(;p{var l,s;n.lastVisitedIndex=Math.min(n.lastVisitedIndex,o-1),(l=t.exposed)==null||l.getItemStyleCache(-1),r&&((s=t.proxy)==null||s.$forceUpdate())},n},clearCache:!1,validateProps:({itemSize:e})=>{}}),iU=({atXEndEdge:e,atXStartEdge:t,atYEndEdge:n,atYStartEdge:o},r)=>{let l=null,s=0,a=0;const u=(d,f)=>{const p=d<=0&&t.value||d>=0&&e.value,v=f<=0&&o.value||f>=0&&n.value;return p&&v};return{hasReachedEdge:u,onWheel:d=>{dc(l);let f=d.deltaX,p=d.deltaY;Math.abs(f)>Math.abs(p)?p=0:f=0,d.shiftKey&&p!==0&&(f=p,p=0),!(u(s,a)&&u(s+f,a+p))&&(s+=f,a+=p,d.preventDefault(),l=wa(()=>{r(s,a),s=0,a=0}))}}},a_=({name:e,clearCache:t,getColumnPosition:n,getColumnStartIndexForOffset:o,getColumnStopIndexForStartIndex:r,getEstimatedTotalHeight:l,getEstimatedTotalWidth:s,getColumnOffset:a,getRowOffset:u,getRowPosition:c,getRowStartIndexForOffset:d,getRowStopIndexForStartIndex:f,initCache:p,injectToInstance:v,validateProps:m})=>G({name:e??"ElVirtualList",props:cl,emits:[Nu,Mu],setup(h,{emit:g,expose:y,slots:w}){const b=ye("vl");m(h);const _=ut(),k=N(p(h,_));v==null||v(_,k);const $=N(),M=N(),O=N(),P=N(null),A=N({isScrolling:!1,scrollLeft:Xe(h.initScrollLeft)?h.initScrollLeft:0,scrollTop:Xe(h.initScrollTop)?h.initScrollTop:0,updateRequested:!1,xAxisScrollDir:Dl,yAxisScrollDir:Dl}),V=J2(),B=C(()=>Number.parseInt(`${h.height}`,10)),D=C(()=>Number.parseInt(`${h.width}`,10)),H=C(()=>{const{totalColumn:ce,totalRow:Te,columnCache:be}=h,{isScrolling:Ee,xAxisScrollDir:_e,scrollLeft:Le}=i(A);if(ce===0||Te===0)return[0,0,0,0];const Re=o(h,Le,i(k)),pe=r(h,Re,Le,i(k)),Ae=!Ee||_e===Iu?Math.max(1,be):1,qe=!Ee||_e===Dl?Math.max(1,be):1;return[Math.max(0,Re-Ae),Math.max(0,Math.min(ce-1,pe+qe)),Re,pe]}),W=C(()=>{const{totalColumn:ce,totalRow:Te,rowCache:be}=h,{isScrolling:Ee,yAxisScrollDir:_e,scrollTop:Le}=i(A);if(ce===0||Te===0)return[0,0,0,0];const Re=d(h,Le,i(k)),pe=f(h,Re,Le,i(k)),Ae=!Ee||_e===Iu?Math.max(1,be):1,qe=!Ee||_e===Dl?Math.max(1,be):1;return[Math.max(0,Re-Ae),Math.max(0,Math.min(Te-1,pe+qe)),Re,pe]}),F=C(()=>l(h,i(k))),T=C(()=>s(h,i(k))),L=C(()=>{var ce;return[{position:"relative",overflow:"hidden",WebkitOverflowScrolling:"touch",willChange:"transform"},{direction:h.direction,height:Xe(h.height)?`${h.height}px`:h.height,width:Xe(h.width)?`${h.width}px`:h.width},(ce=h.style)!=null?ce:{}]}),R=C(()=>{const ce=`${i(T)}px`;return{height:`${i(F)}px`,pointerEvents:i(A).isScrolling?"none":void 0,width:ce}}),U=()=>{const{totalColumn:ce,totalRow:Te}=h;if(ce>0&&Te>0){const[pe,Ae,qe,rt]=i(H),[Ye,Se,ke,ie]=i(W);g(Nu,{columnCacheStart:pe,columnCacheEnd:Ae,rowCacheStart:Ye,rowCacheEnd:Se,columnVisibleStart:qe,columnVisibleEnd:rt,rowVisibleStart:ke,rowVisibleEnd:ie})}const{scrollLeft:be,scrollTop:Ee,updateRequested:_e,xAxisScrollDir:Le,yAxisScrollDir:Re}=i(A);g(Mu,{xAxisScrollDir:Le,scrollLeft:be,yAxisScrollDir:Re,scrollTop:Ee,updateRequested:_e})},ne=ce=>{const{clientHeight:Te,clientWidth:be,scrollHeight:Ee,scrollLeft:_e,scrollTop:Le,scrollWidth:Re}=ce.currentTarget,pe=i(A);if(pe.scrollTop===Le&&pe.scrollLeft===_e)return;let Ae=_e;if(Qg(h.direction))switch(Ru()){case Ia:Ae=-_e;break;case Ih:Ae=Re-be-_e;break}A.value={...pe,isScrolling:!0,scrollLeft:Ae,scrollTop:Math.max(0,Math.min(Le,Ee-Te)),updateRequested:!0,xAxisScrollDir:nl(pe.scrollLeft,Ae),yAxisScrollDir:nl(pe.scrollTop,Le)},Ke(()=>X()),le(),U()},j=(ce,Te)=>{const be=i(B),Ee=(F.value-be)/Te*ce;ee({scrollTop:Math.min(F.value-be,Ee)})},Q=(ce,Te)=>{const be=i(D),Ee=(T.value-be)/Te*ce;ee({scrollLeft:Math.min(T.value-be,Ee)})},{onWheel:he}=iU({atXStartEdge:C(()=>A.value.scrollLeft<=0),atXEndEdge:C(()=>A.value.scrollLeft>=T.value-i(D)),atYStartEdge:C(()=>A.value.scrollTop<=0),atYEndEdge:C(()=>A.value.scrollTop>=F.value-i(B))},(ce,Te)=>{var be,Ee,_e,Le;(Ee=(be=M.value)==null?void 0:be.onMouseUp)==null||Ee.call(be),(Le=(_e=M.value)==null?void 0:_e.onMouseUp)==null||Le.call(_e);const Re=i(D),pe=i(B);ee({scrollLeft:Math.min(A.value.scrollLeft+ce,T.value-Re),scrollTop:Math.min(A.value.scrollTop+Te,F.value-pe)})}),ee=({scrollLeft:ce=A.value.scrollLeft,scrollTop:Te=A.value.scrollTop})=>{ce=Math.max(ce,0),Te=Math.max(Te,0);const be=i(A);Te===be.scrollTop&&ce===be.scrollLeft||(A.value={...be,xAxisScrollDir:nl(be.scrollLeft,ce),yAxisScrollDir:nl(be.scrollTop,Te),scrollLeft:ce,scrollTop:Te,updateRequested:!0},Ke(()=>X()),le(),U())},Z=(ce=0,Te=0,be=Gn)=>{const Ee=i(A);Te=Math.max(0,Math.min(Te,h.totalColumn-1)),ce=Math.max(0,Math.min(ce,h.totalRow-1));const _e=o1(b.namespace.value),Le=i(k),Re=l(h,Le),pe=s(h,Le);ee({scrollLeft:a(h,Te,be,Ee.scrollLeft,Le,pe>h.width?_e:0),scrollTop:u(h,ce,be,Ee.scrollTop,Le,Re>h.height?_e:0)})},te=(ce,Te)=>{const{columnWidth:be,direction:Ee,rowHeight:_e}=h,Le=V.value(t&&be,t&&_e,t&&Ee),Re=`${ce},${Te}`;if(gt(Le,Re))return Le[Re];{const[,pe]=n(h,Te,i(k)),Ae=i(k),qe=Qg(Ee),[rt,Ye]=c(h,ce,Ae),[Se]=n(h,Te,Ae);return Le[Re]={position:"absolute",left:qe?void 0:`${pe}px`,right:qe?`${pe}px`:void 0,top:`${Ye}px`,height:`${rt}px`,width:`${Se}px`},Le[Re]}},X=()=>{A.value.isScrolling=!1,Ke(()=>{V.value(-1,null,null)})};tt(()=>{if(!bt)return;const{initScrollLeft:ce,initScrollTop:Te}=h,be=i($);be&&(Xe(ce)&&(be.scrollLeft=ce),Xe(Te)&&(be.scrollTop=Te)),U()});const le=()=>{const{direction:ce}=h,{scrollLeft:Te,scrollTop:be,updateRequested:Ee}=i(A),_e=i($);if(Ee&&_e){if(ce===ql)switch(Ru()){case Ia:{_e.scrollLeft=-Te;break}case Mh:{_e.scrollLeft=Te;break}default:{const{clientWidth:Le,scrollWidth:Re}=_e;_e.scrollLeft=Re-Le-Te;break}}else _e.scrollLeft=Math.max(0,Te);_e.scrollTop=Math.max(0,be)}},{resetAfterColumnIndex:de,resetAfterRowIndex:Ie,resetAfter:K}=_.proxy;y({windowRef:$,innerRef:P,getItemStyleCache:V,scrollTo:ee,scrollToItem:Z,states:A,resetAfterColumnIndex:de,resetAfterRowIndex:Ie,resetAfter:K});const J=()=>{const{scrollbarAlwaysOn:ce,scrollbarStartGap:Te,scrollbarEndGap:be,totalColumn:Ee,totalRow:_e}=h,Le=i(D),Re=i(B),pe=i(T),Ae=i(F),{scrollLeft:qe,scrollTop:rt}=i(A),Ye=je(If,{ref:M,alwaysOn:ce,startGap:Te,endGap:be,class:b.e("horizontal"),clientSize:Le,layout:"horizontal",onScroll:Q,ratio:Le*100/pe,scrollFrom:qe/(pe-Le),total:_e,visible:!0}),Se=je(If,{ref:O,alwaysOn:ce,startGap:Te,endGap:be,class:b.e("vertical"),clientSize:Re,layout:"vertical",onScroll:j,ratio:Re*100/Ae,scrollFrom:rt/(Ae-Re),total:Ee,visible:!0});return{horizontalScrollbar:Ye,verticalScrollbar:Se}},fe=()=>{var ce;const[Te,be]=i(H),[Ee,_e]=i(W),{data:Le,totalColumn:Re,totalRow:pe,useIsScrolling:Ae,itemKey:qe}=h,rt=[];if(pe>0&&Re>0)for(let Ye=Ee;Ye<=_e;Ye++)for(let Se=Te;Se<=be;Se++)rt.push((ce=w.default)==null?void 0:ce.call(w,{columnIndex:Se,data:Le,key:qe({columnIndex:Se,data:Le,rowIndex:Ye}),isScrolling:Ae?i(A).isScrolling:void 0,style:te(Ye,Se),rowIndex:Ye}));return rt},ge=()=>{const ce=vt(h.innerElement),Te=fe();return[je(ce,{style:i(R),ref:P},Ze(ce)?Te:{default:()=>Te})]};return()=>{const ce=vt(h.containerElement),{horizontalScrollbar:Te,verticalScrollbar:be}=J(),Ee=ge();return je("div",{key:0,class:b.e("wrapper"),role:h.role},[je(ce,{class:h.className,style:i(L),onScroll:ne,onWheel:he,ref:$},Ze(ce)?Ee:{default:()=>Ee}),Te,be])}}}),uU=a_({name:"ElFixedSizeGrid",getColumnPosition:({columnWidth:e},t)=>[e,t*e],getRowPosition:({rowHeight:e},t)=>[e,t*e],getEstimatedTotalHeight:({totalRow:e,rowHeight:t})=>t*e,getEstimatedTotalWidth:({totalColumn:e,columnWidth:t})=>t*e,getColumnOffset:({totalColumn:e,columnWidth:t,width:n},o,r,l,s,a)=>{n=Number(n);const u=Math.max(0,e*t-n),c=Math.min(u,o*t),d=Math.max(0,o*t-n+a+t);switch(r==="smart"&&(l>=d-n&&l<=c+n?r=Gn:r=Oo),r){case Na:return c;case Ma:return d;case Oo:{const f=Math.round(d+(c-d)/2);return fu+Math.floor(n/2)?u:f}case Gn:default:return l>=d&&l<=c?l:d>c||l{t=Number(t);const u=Math.max(0,n*e-t),c=Math.min(u,o*e),d=Math.max(0,o*e-t+a+e);switch(r===kc&&(l>=d-t&&l<=c+t?r=Gn:r=Oo),r){case Na:return c;case Ma:return d;case Oo:{const f=Math.round(d+(c-d)/2);return fu+Math.floor(t/2)?u:f}case Gn:default:return l>=d&&l<=c?l:d>c||lMath.max(0,Math.min(t-1,Math.floor(n/e))),getColumnStopIndexForStartIndex:({columnWidth:e,totalColumn:t,width:n},o,r)=>{const l=o*e,s=Math.ceil((n+r-l)/e);return Math.max(0,Math.min(t-1,o+s-1))},getRowStartIndexForOffset:({rowHeight:e,totalRow:t},n)=>Math.max(0,Math.min(t-1,Math.floor(n/e))),getRowStopIndexForStartIndex:({rowHeight:e,totalRow:t,height:n},o,r)=>{const l=o*e,s=Math.ceil((n+r-l)/e);return Math.max(0,Math.min(t-1,o+s-1))},initCache:()=>{},clearCache:!0,validateProps:({columnWidth:e,rowHeight:t})=>{}}),{max:Au,min:i_,floor:u_}=Math,cU={column:"columnWidth",row:"rowHeight"},Pf={column:"lastVisitedColumnIndex",row:"lastVisitedRowIndex"},Ko=(e,t,n,o)=>{const[r,l,s]=[n[o],e[cU[o]],n[Pf[o]]];if(t>s){let a=0;if(s>=0){const u=r[s];a=u.offset+u.size}for(let u=s+1;u<=t;u++){const c=l(u);r[u]={offset:a,size:c},a+=c}n[Pf[o]]=t}return r[t]},c_=(e,t,n,o,r,l)=>{for(;n<=o;){const s=n+u_((o-n)/2),a=Ko(e,s,t,l).offset;if(a===r)return s;a{const l=r==="column"?e.totalColumn:e.totalRow;let s=1;for(;n{const[r,l]=[t[o],t[Pf[o]]];return(l>0?r[l].offset:0)>=n?c_(e,t,0,l,n,o):dU(e,t,Au(0,l),n,o)},d_=({totalRow:e},{estimatedRowHeight:t,lastVisitedRowIndex:n,row:o})=>{let r=0;if(n>=e&&(n=e-1),n>=0){const a=o[n];r=a.offset+a.size}const s=(e-n-1)*t;return r+s},f_=({totalColumn:e},{column:t,estimatedColumnWidth:n,lastVisitedColumnIndex:o})=>{let r=0;if(o>e&&(o=e-1),o>=0){const a=t[o];r=a.offset+a.size}const s=(e-o-1)*n;return r+s},fU={column:f_,row:d_},ny=(e,t,n,o,r,l,s)=>{const[a,u]=[l==="row"?e.height:e.width,fU[l]],c=Ko(e,t,r,l),d=u(e,r),f=Au(0,i_(d-a,c.offset)),p=Au(0,c.offset-a+s+c.size);switch(n===kc&&(o>=p-a&&o<=f+a?n=Gn:n=Oo),n){case Na:return f;case Ma:return p;case Oo:return Math.round(p+(f-p)/2);case Gn:default:return o>=p&&o<=f?o:p>f||o{const o=Ko(e,t,n,"column");return[o.size,o.offset]},getRowPosition:(e,t,n)=>{const o=Ko(e,t,n,"row");return[o.size,o.offset]},getColumnOffset:(e,t,n,o,r,l)=>ny(e,t,n,o,r,"column",l),getRowOffset:(e,t,n,o,r,l)=>ny(e,t,n,o,r,"row",l),getColumnStartIndexForOffset:(e,t,n)=>ty(e,n,t,"column"),getColumnStopIndexForStartIndex:(e,t,n,o)=>{const r=Ko(e,t,o,"column"),l=n+e.width;let s=r.offset+r.size,a=t;for(;aty(e,n,t,"row"),getRowStopIndexForStartIndex:(e,t,n,o)=>{const{totalRow:r,height:l}=e,s=Ko(e,t,o,"row"),a=n+l;let u=s.size+s.offset,c=t;for(;c{const n=({columnIndex:l,rowIndex:s},a)=>{var u,c;a=an(a)?!0:a,Xe(l)&&(t.value.lastVisitedColumnIndex=Math.min(t.value.lastVisitedColumnIndex,l-1)),Xe(s)&&(t.value.lastVisitedRowIndex=Math.min(t.value.lastVisitedRowIndex,s-1)),(u=e.exposed)==null||u.getItemStyleCache.value(-1,null,null),a&&((c=e.proxy)==null||c.$forceUpdate())},o=(l,s)=>{n({columnIndex:l},s)},r=(l,s)=>{n({rowIndex:l},s)};Object.assign(e.proxy,{resetAfterColumnIndex:o,resetAfterRowIndex:r,resetAfter:n})},initCache:({estimatedColumnWidth:e=$f,estimatedRowHeight:t=$f})=>({column:{},estimatedColumnWidth:e,estimatedRowHeight:t,lastVisitedColumnIndex:-1,lastVisitedRowIndex:-1,row:{}}),clearCache:!1,validateProps:({columnWidth:e,rowHeight:t})=>{}}),hU=G({props:{item:{type:Object,required:!0},style:Object,height:Number},setup(){return{ns:ye("select")}}});function vU(e,t,n,o,r,l){return e.item.isTitle?(S(),x("div",{key:0,class:E(e.ns.be("group","title")),style:He([e.style,{lineHeight:`${e.height}px`}])},ue(e.item.label),7)):(S(),x("div",{key:1,class:E(e.ns.be("group","split")),style:He(e.style)},[I("span",{class:E(e.ns.be("group","split-dash")),style:He({top:`${e.height/2}px`})},null,6)],6))}var mU=Ne(hU,[["render",vU],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/group-item.vue"]]);function gU(e,{emit:t}){return{hoverItem:()=>{e.disabled||t("hover",e.index)},selectOptionClick:()=>{e.disabled||t("select",e.item,e.index)}}}const yU={allowCreate:Boolean,autocomplete:{type:String,default:"none"},automaticDropdown:Boolean,clearable:Boolean,clearIcon:{type:[String,Object],default:Lr},effect:{type:String,default:"light"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},maxCollapseTags:{type:Number,default:1},defaultFirstOption:Boolean,disabled:Boolean,estimatedOptionHeight:{type:Number,default:void 0},filterable:Boolean,filterMethod:Function,height:{type:Number,default:170},itemHeight:{type:Number,default:34},id:String,loading:Boolean,loadingText:String,label:String,modelValue:[Array,String,Number,Boolean,Object],multiple:Boolean,multipleLimit:{type:Number,default:0},name:String,noDataText:String,noMatchText:String,remoteMethod:Function,reserveKeyword:{type:Boolean,default:!0},options:{type:Array,required:!0},placeholder:{type:String},teleported:sn.teleported,persistent:{type:Boolean,default:!0},popperClass:{type:String,default:""},popperOptions:{type:Object,default:()=>({})},remote:Boolean,size:{type:String,validator:uc},valueKey:{type:String,default:"value"},scrollbarAlwaysOn:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0},placement:{type:se(String),values:Cl,default:"bottom-start"}},bU={data:Array,disabled:Boolean,hovering:Boolean,item:Object,index:Number,style:Object,selected:Boolean,created:Boolean},wU=G({props:bU,emits:["select","hover"],setup(e,{emit:t}){const n=ye("select"),{hoverItem:o,selectOptionClick:r}=gU(e,{emit:t});return{ns:n,hoverItem:o,selectOptionClick:r}}}),_U=["aria-selected"];function CU(e,t,n,o,r,l){return S(),x("li",{"aria-selected":e.selected,style:He(e.style),class:E([e.ns.be("dropdown","option-item"),e.ns.is("selected",e.selected),e.ns.is("disabled",e.disabled),e.ns.is("created",e.created),{hover:e.hovering}]),onMouseenter:t[0]||(t[0]=(...s)=>e.hoverItem&&e.hoverItem(...s)),onClick:t[1]||(t[1]=Ge((...s)=>e.selectOptionClick&&e.selectOptionClick(...s),["stop"]))},[ve(e.$slots,"default",{item:e.item,index:e.index,disabled:e.disabled},()=>[I("span",null,ue(e.item.label),1)])],46,_U)}var SU=Ne(wU,[["render",CU],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/option-item.vue"]]);const p_=Symbol("ElSelectV2Injection");var kU=G({name:"ElSelectDropdown",props:{data:{type:Array,required:!0},hoveringIndex:Number,width:Number},setup(e,{slots:t,expose:n}){const o=De(p_),r=ye("select"),l=N([]),s=N(),a=C(()=>e.data.length);me(()=>a.value,()=>{var O,P;(P=(O=o.popper.value).updatePopper)==null||P.call(O)});const u=C(()=>an(o.props.estimatedOptionHeight)),c=C(()=>u.value?{itemSize:o.props.itemHeight}:{estimatedSize:o.props.estimatedOptionHeight,itemSize:O=>l.value[O]}),d=(O=[],P)=>{const{props:{valueKey:A}}=o;return ft(P)?O&&O.some(V=>Bt(V,A)===Bt(P,A)):O.includes(P)},f=(O,P)=>{if(ft(P)){const{valueKey:A}=o.props;return Bt(O,A)===Bt(P,A)}else return O===P},p=(O,P)=>{const{valueKey:A}=o.props;return o.props.multiple?d(O,Bt(P,A)):f(O,Bt(P,A))},v=(O,P)=>{const{disabled:A,multiple:V,multipleLimit:B}=o.props;return A||!P&&(V?B>0&&O.length>=B:!1)},m=O=>e.hoveringIndex===O;n({listRef:s,isSized:u,isItemDisabled:v,isItemHovering:m,isItemSelected:p,scrollToItem:O=>{const P=s.value;P&&P.scrollToItem(O)},resetScrollTop:()=>{const O=s.value;O&&O.resetScrollTop()}});const y=O=>{const{index:P,data:A,style:V}=O,B=i(u),{itemSize:D,estimatedSize:H}=i(c),{modelValue:W}=o.props,{onSelect:F,onHover:T}=o,L=A[P];if(L.type==="Group")return z(mU,{item:L,style:V,height:B?D:H},null);const R=p(W,L),U=v(W,R),ne=m(P);return z(SU,pt(O,{selected:R,disabled:L.disabled||U,created:!!L.created,hovering:ne,item:L,onSelect:F,onHover:T}),{default:j=>{var Q;return((Q=t.default)==null?void 0:Q.call(t,j))||z("span",null,[L.label])}})},{onKeyboardNavigate:w,onKeyboardSelect:b}=o,_=()=>{w("forward")},k=()=>{w("backward")},$=()=>{o.expanded=!1},M=O=>{const{code:P}=O,{tab:A,esc:V,down:B,up:D,enter:H}=We;switch(P!==A&&(O.preventDefault(),O.stopPropagation()),P){case A:case V:{$();break}case B:{_();break}case D:{k();break}case H:{b();break}}};return()=>{var O;const{data:P,width:A}=e,{height:V,multiple:B,scrollbarAlwaysOn:D}=o.props;if(P.length===0)return z("div",{class:r.b("dropdown"),style:{width:`${A}px`}},[(O=t.empty)==null?void 0:O.call(t)]);const H=i(u)?l_:aU;return z("div",{class:[r.b("dropdown"),r.is("multiple",B)]},[z(H,pt({ref:s},i(c),{className:r.be("dropdown","list"),scrollbarAlwaysOn:D,data:P,height:V,width:A,total:P.length,onKeydown:M}),{default:W=>z(y,W,null)})])}}});function $U(e,t){const n=N(0),o=N(null),r=C(()=>e.allowCreate&&e.filterable);function l(d){const f=p=>p.value===d;return e.options&&e.options.some(f)||t.createdOptions.some(f)}function s(d){r.value&&(e.multiple&&d.created?n.value++:o.value=d)}function a(d){if(r.value)if(d&&d.length>0&&!l(d)){const f={value:d,label:d,created:!0,disabled:!1};t.createdOptions.length>=n.value?t.createdOptions[n.value]=f:t.createdOptions.push(f)}else if(e.multiple)t.createdOptions.length=n.value;else{const f=o.value;t.createdOptions.length=0,f&&f.created&&t.createdOptions.push(f)}}function u(d){if(!r.value||!d||!d.created||d.created&&e.reserveKeyword&&t.inputValue===d.label)return;const f=t.createdOptions.findIndex(p=>p.value===d.value);~f&&(t.createdOptions.splice(f,1),n.value--)}function c(){r.value&&(t.createdOptions.length=0,n.value=0)}return{createNewOption:a,removeNewOption:u,selectNewOption:s,clearAllNewOption:c}}const EU=e=>{const t=[];return e.forEach(n=>{Ve(n.options)?(t.push({label:n.label,isTitle:!0,type:"Group"}),n.options.forEach(o=>{t.push(o)}),t.push({type:"Group"})):t.push(n)}),t};function TU(e){const t=N(!1);return{handleCompositionStart:()=>{t.value=!0},handleCompositionUpdate:l=>{const s=l.target.value,a=s[s.length-1]||"";t.value=!cc(a)},handleCompositionEnd:l=>{t.value&&(t.value=!1,Je(e)&&e(l))}}}const oy="",ry=11,OU={larget:51,default:42,small:33},NU=(e,t)=>{const{t:n}=Ct(),o=ye("select-v2"),r=ye("input"),{form:l,formItem:s}=Tn(),a=yt({inputValue:oy,displayInputValue:oy,calculatedWidth:0,cachedPlaceholder:"",cachedOptions:[],createdOptions:[],createdLabel:"",createdSelected:!1,currentPlaceholder:"",hoveringIndex:-1,comboBoxHovering:!1,isOnComposition:!1,isSilentBlur:!1,isComposing:!1,inputLength:20,selectWidth:200,initialInputHeight:0,previousQuery:null,previousValue:void 0,query:"",selectedLabel:"",softFocus:!1,tagInMultiLine:!1}),u=N(-1),c=N(-1),d=N(null),f=N(null),p=N(null),v=N(null),m=N(null),h=N(null),g=N(null),y=N(!1),w=C(()=>e.disabled||(l==null?void 0:l.disabled)),b=C(()=>{const $e=B.value.length*34;return $e>e.height?e.height:$e}),_=C(()=>!nn(e.modelValue)),k=C(()=>{const $e=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:_.value;return e.clearable&&!w.value&&a.comboBoxHovering&&$e}),$=C(()=>e.remote&&e.filterable?"":Xa),M=C(()=>$.value&&o.is("reverse",y.value)),O=C(()=>(s==null?void 0:s.validateState)||""),P=C(()=>h1[O.value]),A=C(()=>e.remote?300:0),V=C(()=>{const $e=B.value;return e.loading?e.loadingText||n("el.select.loading"):e.remote&&a.inputValue===""&&$e.length===0?!1:e.filterable&&a.inputValue&&$e.length>0?e.noMatchText||n("el.select.noMatch"):$e.length===0?e.noDataText||n("el.select.noData"):null}),B=C(()=>{const $e=Ue=>{const St=a.inputValue,$t=new RegExp(t1(St),"i");return St?$t.test(Ue.label||""):!0};return e.loading?[]:EU(e.options.concat(a.createdOptions).map(Ue=>{if(Ve(Ue.options)){const St=Ue.options.filter($e);if(St.length>0)return{...Ue,options:St}}else if(e.remote||$e(Ue))return Ue;return null}).filter(Ue=>Ue!==null))}),D=C(()=>B.value.every($e=>$e.disabled)),H=Jt(),W=C(()=>H.value==="small"?"small":"default"),F=C(()=>{const $e=h.value,Ue=W.value||"default",St=$e?Number.parseInt(getComputedStyle($e).paddingLeft):0,$t=$e?Number.parseInt(getComputedStyle($e).paddingRight):0;return a.selectWidth-$t-St-OU[Ue]}),T=()=>{var $e;c.value=(($e=m.value)==null?void 0:$e.offsetWidth)||200},L=C(()=>({width:`${a.calculatedWidth===0?ry:Math.ceil(a.calculatedWidth)+ry}px`})),R=C(()=>Ve(e.modelValue)?e.modelValue.length===0&&!a.displayInputValue:e.filterable?a.displayInputValue.length===0:!0),U=C(()=>{const $e=e.placeholder||n("el.select.placeholder");return e.multiple||nn(e.modelValue)?$e:a.selectedLabel}),ne=C(()=>{var $e,Ue;return(Ue=($e=v.value)==null?void 0:$e.popperRef)==null?void 0:Ue.contentRef}),j=C(()=>{if(e.multiple){const $e=e.modelValue.length;if(e.modelValue.length>0)return B.value.findIndex(Ue=>Ue.value===e.modelValue[$e-1])}else if(e.modelValue)return B.value.findIndex($e=>$e.value===e.modelValue);return-1}),Q=C({get(){return y.value&&V.value!==!1},set($e){y.value=$e}}),he=C(()=>a.cachedOptions.slice(0,e.maxCollapseTags)),ee=C(()=>a.cachedOptions.slice(e.maxCollapseTags)),{createNewOption:Z,removeNewOption:te,selectNewOption:X,clearAllNewOption:le}=$U(e,a),{handleCompositionStart:de,handleCompositionUpdate:Ie,handleCompositionEnd:K}=TU($e=>at($e)),J=()=>{var $e,Ue,St;(Ue=($e=f.value)==null?void 0:$e.focus)==null||Ue.call($e),(St=v.value)==null||St.updatePopper()},fe=()=>{if(!e.automaticDropdown&&!w.value)return a.isComposing&&(a.softFocus=!0),Ke(()=>{var $e,Ue;y.value=!y.value,(Ue=($e=f.value)==null?void 0:$e.focus)==null||Ue.call($e)})},ge=()=>(e.filterable&&a.inputValue!==a.selectedLabel&&(a.query=a.selectedLabel),ce(a.inputValue),Ke(()=>{Z(a.inputValue)})),Oe=$n(ge,A.value),ce=$e=>{a.previousQuery!==$e&&(a.previousQuery=$e,e.filterable&&Je(e.filterMethod)?e.filterMethod($e):e.filterable&&e.remote&&Je(e.remoteMethod)&&e.remoteMethod($e))},Te=$e=>{jn(e.modelValue,$e)||t(At,$e)},be=$e=>{t(dt,$e),Te($e),a.previousValue=$e==null?void 0:$e.toString()},Ee=($e=[],Ue)=>{if(!ft(Ue))return $e.indexOf(Ue);const St=e.valueKey;let $t=-1;return $e.some((ln,Co)=>Bt(ln,St)===Bt(Ue,St)?($t=Co,!0):!1),$t},_e=$e=>ft($e)?Bt($e,e.valueKey):$e,Le=$e=>ft($e)?$e.label:$e,Re=()=>Ke(()=>{var $e,Ue;if(!f.value)return;const St=h.value;m.value.height=St.offsetHeight,y.value&&V.value!==!1&&((Ue=($e=v.value)==null?void 0:$e.updatePopper)==null||Ue.call($e))}),pe=()=>{var $e,Ue;if(Ae(),T(),(Ue=($e=v.value)==null?void 0:$e.updatePopper)==null||Ue.call($e),e.multiple)return Re()},Ae=()=>{const $e=h.value;$e&&(a.selectWidth=$e.getBoundingClientRect().width)},qe=($e,Ue,St=!0)=>{var $t,ln;if(e.multiple){let Co=e.modelValue.slice();const ai=Ee(Co,_e($e));ai>-1?(Co=[...Co.slice(0,ai),...Co.slice(ai+1)],a.cachedOptions.splice(ai,1),te($e)):(e.multipleLimit<=0||Co.length{const{valueKey:St}=e,$t=e.modelValue.indexOf(Bt(Ue,St));if($t>-1&&!w.value){const ln=[...e.modelValue.slice(0,$t),...e.modelValue.slice($t+1)];return a.cachedOptions.splice($t,1),be(ln),t("remove-tag",Bt(Ue,St)),a.softFocus=!0,te(Ue),Ke(J)}$e.stopPropagation()},Ye=$e=>{const Ue=a.isComposing;a.isComposing=!0,a.softFocus?a.softFocus=!1:Ue||t("focus",$e)},Se=$e=>(a.softFocus=!1,Ke(()=>{var Ue,St;(St=(Ue=f.value)==null?void 0:Ue.blur)==null||St.call(Ue),g.value&&(a.calculatedWidth=g.value.getBoundingClientRect().width),a.isSilentBlur?a.isSilentBlur=!1:a.isComposing&&t("blur",$e),a.isComposing=!1})),ke=()=>{a.displayInputValue.length>0?re(""):y.value=!1},ie=$e=>{if(a.displayInputValue.length===0){$e.preventDefault();const Ue=e.modelValue.slice();Ue.pop(),te(a.cachedOptions.pop()),be(Ue)}},Y=()=>{let $e;return Ve(e.modelValue)?$e=[]:$e=void 0,a.softFocus=!0,e.multiple?a.cachedOptions=[]:a.selectedLabel="",y.value=!1,be($e),t("clear"),le(),Ke(J)},re=$e=>{a.displayInputValue=$e,a.inputValue=$e},Ce=($e,Ue=void 0)=>{const St=B.value;if(!["forward","backward"].includes($e)||w.value||St.length<=0||D.value)return;if(!y.value)return fe();Ue===void 0&&(Ue=a.hoveringIndex);let $t=-1;$e==="forward"?($t=Ue+1,$t>=St.length&&($t=0)):$e==="backward"&&($t=Ue-1,($t<0||$t>=St.length)&&($t=St.length-1));const ln=St[$t];if(ln.disabled||ln.type==="Group")return Ce($e,$t);ot($t),Tt($t)},Pe=()=>{if(y.value)~a.hoveringIndex&&B.value[a.hoveringIndex]&&qe(B.value[a.hoveringIndex],a.hoveringIndex,!1);else return fe()},ot=$e=>{a.hoveringIndex=$e},we=()=>{a.hoveringIndex=-1},Fe=()=>{var $e;const Ue=f.value;Ue&&(($e=Ue.focus)==null||$e.call(Ue))},at=$e=>{const Ue=$e.target.value;if(re(Ue),a.displayInputValue.length>0&&!y.value&&(y.value=!0),a.calculatedWidth=g.value.getBoundingClientRect().width,e.multiple&&Re(),e.remote)Oe();else return ge()},ct=()=>(y.value=!1,Se()),mt=()=>(a.inputValue=a.displayInputValue,Ke(()=>{~j.value&&(ot(j.value),Tt(a.hoveringIndex))})),Tt=$e=>{p.value.scrollToItem($e)},tn=()=>{if(we(),e.multiple)if(e.modelValue.length>0){let $e=!1;a.cachedOptions.length=0,a.previousValue=e.modelValue.toString(),e.modelValue.forEach(Ue=>{const St=B.value.findIndex($t=>_e($t)===Ue);~St&&(a.cachedOptions.push(B.value[St]),$e||ot(St),$e=!0)})}else a.cachedOptions=[],a.previousValue=void 0;else if(_.value){a.previousValue=e.modelValue;const $e=B.value,Ue=$e.findIndex(St=>_e(St)===_e(e.modelValue));~Ue?(a.selectedLabel=$e[Ue].label,ot(Ue)):a.selectedLabel=`${e.modelValue}`}else a.selectedLabel="",a.previousValue=void 0;le(),T()};return me(y,$e=>{var Ue,St;t("visible-change",$e),$e?(St=(Ue=v.value).update)==null||St.call(Ue):(a.displayInputValue="",a.previousQuery=null,Z(""))}),me(()=>e.modelValue,($e,Ue)=>{var St;(!$e||$e.toString()!==a.previousValue)&&tn(),!jn($e,Ue)&&e.validateEvent&&((St=s==null?void 0:s.validate)==null||St.call(s,"change").catch($t=>void 0))},{deep:!0}),me(()=>e.options,()=>{const $e=f.value;(!$e||$e&&document.activeElement!==$e)&&tn()},{deep:!0}),me(B,()=>Ke(p.value.resetScrollTop)),me(()=>Q.value,$e=>{$e||we()}),tt(()=>{tn()}),gn(m,pe),{collapseTagSize:W,currentPlaceholder:U,expanded:y,emptyText:V,popupHeight:b,debounce:A,filteredOptions:B,iconComponent:$,iconReverse:M,inputWrapperStyle:L,popperSize:c,dropdownMenuVisible:Q,hasModelValue:_,shouldShowPlaceholder:R,selectDisabled:w,selectSize:H,showClearBtn:k,states:a,tagMaxWidth:F,nsSelectV2:o,nsInput:r,calculatorRef:g,controlRef:d,inputRef:f,menuRef:p,popper:v,selectRef:m,selectionRef:h,popperRef:ne,validateState:O,validateIcon:P,showTagList:he,collapseTagList:ee,debouncedOnInputChange:Oe,deleteTag:rt,getLabel:Le,getValueKey:_e,handleBlur:Se,handleClear:Y,handleClickOutside:ct,handleDel:ie,handleEsc:ke,handleFocus:Ye,handleMenuEnter:mt,handleResize:pe,toggleMenu:fe,scrollTo:Tt,onInput:at,onKeyboardNavigate:Ce,onKeyboardSelect:Pe,onSelect:qe,onHover:ot,onUpdateInputValue:re,handleCompositionStart:de,handleCompositionEnd:K,handleCompositionUpdate:Ie}},MU=G({name:"ElSelectV2",components:{ElSelectMenu:kU,ElTag:Ta,ElTooltip:En,ElIcon:ze},directives:{ClickOutside:Mr,ModelText:Ka},props:yU,emits:[dt,At,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:t}){const n=C(()=>{const{modelValue:r,multiple:l}=e,s=l?[]:void 0;return Ve(r)?l?r:s:l?s:r}),o=NU(yt({...Qt(e),modelValue:n}),t);return ht(p_,{props:yt({...Qt(e),height:o.popupHeight,modelValue:n}),popper:o.popper,onSelect:o.onSelect,onHover:o.onHover,onKeyboardNavigate:o.onKeyboardNavigate,onKeyboardSelect:o.onKeyboardSelect}),{...o,modelValue:n}}}),IU={key:0},PU=["id","autocomplete","aria-expanded","aria-labelledby","disabled","readonly","name","unselectable"],RU=["textContent"],AU=["id","aria-labelledby","aria-expanded","autocomplete","disabled","name","readonly","unselectable"],xU=["textContent"];function LU(e,t,n,o,r,l){const s=Qe("el-tag"),a=Qe("el-tooltip"),u=Qe("el-icon"),c=Qe("el-select-menu"),d=ca("model-text"),f=ca("click-outside");return et((S(),x("div",{ref:"selectRef",class:E([e.nsSelectV2.b(),e.nsSelectV2.m(e.selectSize)]),onClick:t[24]||(t[24]=Ge((...p)=>e.toggleMenu&&e.toggleMenu(...p),["stop"])),onMouseenter:t[25]||(t[25]=p=>e.states.comboBoxHovering=!0),onMouseleave:t[26]||(t[26]=p=>e.states.comboBoxHovering=!1)},[z(a,{ref:"popper",visible:e.dropdownMenuVisible,teleported:e.teleported,"popper-class":[e.nsSelectV2.e("popper"),e.popperClass],"gpu-acceleration":!1,"stop-popper-mouse-event":!1,"popper-options":e.popperOptions,"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,placement:e.placement,pure:"",transition:`${e.nsSelectV2.namespace.value}-zoom-in-top`,trigger:"click",persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:t[23]||(t[23]=p=>e.states.inputValue=e.states.displayInputValue)},{default:q(()=>[I("div",{ref:"selectionRef",class:E([e.nsSelectV2.e("wrapper"),e.nsSelectV2.is("focused",e.states.isComposing||e.expanded),e.nsSelectV2.is("hovering",e.states.comboBoxHovering),e.nsSelectV2.is("filterable",e.filterable),e.nsSelectV2.is("disabled",e.selectDisabled)])},[e.$slots.prefix?(S(),x("div",IU,[ve(e.$slots,"prefix")])):oe("v-if",!0),e.multiple?(S(),x("div",{key:1,class:E(e.nsSelectV2.e("selection"))},[e.collapseTags&&e.modelValue.length>0?(S(),x(xe,{key:0},[(S(!0),x(xe,null,lt(e.showTagList,p=>(S(),x("div",{key:e.getValueKey(p),class:E(e.nsSelectV2.e("selected-item"))},[z(s,{closable:!e.selectDisabled&&!(p!=null&&p.disable),size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:v=>e.deleteTag(v,p)},{default:q(()=>[I("span",{class:E(e.nsSelectV2.e("tags-text")),style:He({maxWidth:`${e.tagMaxWidth}px`})},ue(p==null?void 0:p.label),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),I("div",{class:E(e.nsSelectV2.e("selected-item"))},[e.modelValue.length>e.maxCollapseTags?(S(),ae(s,{key:0,closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""},{default:q(()=>[e.collapseTagsTooltip?(S(),ae(a,{key:0,disabled:e.dropdownMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:!1},{default:q(()=>[I("span",{class:E(e.nsSelectV2.e("tags-text")),style:He({maxWidth:`${e.tagMaxWidth}px`})},"+ "+ue(e.modelValue.length-e.maxCollapseTags),7)]),content:q(()=>[I("div",{class:E(e.nsSelectV2.e("selection"))},[(S(!0),x(xe,null,lt(e.collapseTagList,p=>(S(),x("div",{key:e.getValueKey(p),class:E(e.nsSelectV2.e("selected-item"))},[z(s,{closable:!e.selectDisabled&&!p.disabled,size:e.collapseTagSize,class:"in-tooltip",type:"info","disable-transitions":"",onClose:v=>e.deleteTag(v,p)},{default:q(()=>[I("span",{class:E(e.nsSelectV2.e("tags-text")),style:He({maxWidth:`${e.tagMaxWidth}px`})},ue(e.getLabel(p)),7)]),_:2},1032,["closable","size","onClose"])],2))),128))],2)]),_:1},8,["disabled","effect"])):(S(),x("span",{key:1,class:E(e.nsSelectV2.e("tags-text")),style:He({maxWidth:`${e.tagMaxWidth}px`})},"+ "+ue(e.modelValue.length-e.maxCollapseTags),7))]),_:1},8,["size"])):oe("v-if",!0)],2)],64)):(S(!0),x(xe,{key:1},lt(e.states.cachedOptions,p=>(S(),x("div",{key:e.getValueKey(p),class:E(e.nsSelectV2.e("selected-item"))},[z(s,{closable:!e.selectDisabled&&!p.disabled,size:e.collapseTagSize,type:"info","disable-transitions":"",onClose:v=>e.deleteTag(v,p)},{default:q(()=>[I("span",{class:E(e.nsSelectV2.e("tags-text")),style:He({maxWidth:`${e.tagMaxWidth}px`})},ue(e.getLabel(p)),7)]),_:2},1032,["closable","size","onClose"])],2))),128)),I("div",{class:E([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")]),style:He(e.inputWrapperStyle)},[et(I("input",{id:e.id,ref:"inputRef",autocomplete:e.autocomplete,"aria-autocomplete":"list","aria-haspopup":"listbox",autocapitalize:"off","aria-expanded":e.expanded,"aria-labelledby":e.label,class:E([e.nsSelectV2.is(e.selectSize),e.nsSelectV2.e("combobox-input")]),disabled:e.disabled,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",name:e.name,unselectable:e.expanded?"on":void 0,"onUpdate:modelValue":t[0]||(t[0]=(...p)=>e.onUpdateInputValue&&e.onUpdateInputValue(...p)),onFocus:t[1]||(t[1]=(...p)=>e.handleFocus&&e.handleFocus(...p)),onBlur:t[2]||(t[2]=(...p)=>e.handleBlur&&e.handleBlur(...p)),onInput:t[3]||(t[3]=(...p)=>e.onInput&&e.onInput(...p)),onCompositionstart:t[4]||(t[4]=(...p)=>e.handleCompositionStart&&e.handleCompositionStart(...p)),onCompositionupdate:t[5]||(t[5]=(...p)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...p)),onCompositionend:t[6]||(t[6]=(...p)=>e.handleCompositionEnd&&e.handleCompositionEnd(...p)),onKeydown:[t[7]||(t[7]=wt(Ge(p=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),t[8]||(t[8]=wt(Ge(p=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),t[9]||(t[9]=wt(Ge((...p)=>e.onKeyboardSelect&&e.onKeyboardSelect(...p),["stop","prevent"]),["enter"])),t[10]||(t[10]=wt(Ge((...p)=>e.handleEsc&&e.handleEsc(...p),["stop","prevent"]),["esc"])),t[11]||(t[11]=wt(Ge((...p)=>e.handleDel&&e.handleDel(...p),["stop"]),["delete"]))]},null,42,PU),[[d,e.states.displayInputValue]]),e.filterable?(S(),x("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:E(e.nsSelectV2.e("input-calculator")),textContent:ue(e.states.displayInputValue)},null,10,RU)):oe("v-if",!0)],6)],2)):(S(),x(xe,{key:2},[I("div",{class:E([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-wrapper")])},[et(I("input",{id:e.id,ref:"inputRef","aria-autocomplete":"list","aria-haspopup":"listbox","aria-labelledby":e.label,"aria-expanded":e.expanded,autocapitalize:"off",autocomplete:e.autocomplete,class:E(e.nsSelectV2.e("combobox-input")),disabled:e.disabled,name:e.name,role:"combobox",readonly:!e.filterable,spellcheck:"false",type:"text",unselectable:e.expanded?"on":void 0,onCompositionstart:t[12]||(t[12]=(...p)=>e.handleCompositionStart&&e.handleCompositionStart(...p)),onCompositionupdate:t[13]||(t[13]=(...p)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...p)),onCompositionend:t[14]||(t[14]=(...p)=>e.handleCompositionEnd&&e.handleCompositionEnd(...p)),onFocus:t[15]||(t[15]=(...p)=>e.handleFocus&&e.handleFocus(...p)),onBlur:t[16]||(t[16]=(...p)=>e.handleBlur&&e.handleBlur(...p)),onInput:t[17]||(t[17]=(...p)=>e.onInput&&e.onInput(...p)),onKeydown:[t[18]||(t[18]=wt(Ge(p=>e.onKeyboardNavigate("backward"),["stop","prevent"]),["up"])),t[19]||(t[19]=wt(Ge(p=>e.onKeyboardNavigate("forward"),["stop","prevent"]),["down"])),t[20]||(t[20]=wt(Ge((...p)=>e.onKeyboardSelect&&e.onKeyboardSelect(...p),["stop","prevent"]),["enter"])),t[21]||(t[21]=wt(Ge((...p)=>e.handleEsc&&e.handleEsc(...p),["stop","prevent"]),["esc"]))],"onUpdate:modelValue":t[22]||(t[22]=(...p)=>e.onUpdateInputValue&&e.onUpdateInputValue(...p))},null,42,AU),[[d,e.states.displayInputValue]])],2),e.filterable?(S(),x("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:E([e.nsSelectV2.e("selected-item"),e.nsSelectV2.e("input-calculator")]),textContent:ue(e.states.displayInputValue)},null,10,xU)):oe("v-if",!0)],64)),e.shouldShowPlaceholder?(S(),x("span",{key:3,class:E([e.nsSelectV2.e("placeholder"),e.nsSelectV2.is("transparent",e.multiple?e.modelValue.length===0:!e.hasModelValue)])},ue(e.currentPlaceholder),3)):oe("v-if",!0),I("span",{class:E(e.nsSelectV2.e("suffix"))},[e.iconComponent?et((S(),ae(u,{key:0,class:E([e.nsSelectV2.e("caret"),e.nsInput.e("icon"),e.iconReverse])},{default:q(()=>[(S(),ae(vt(e.iconComponent)))]),_:1},8,["class"])),[[kt,!e.showClearBtn]]):oe("v-if",!0),e.showClearBtn&&e.clearIcon?(S(),ae(u,{key:1,class:E([e.nsSelectV2.e("caret"),e.nsInput.e("icon")]),onClick:Ge(e.handleClear,["prevent","stop"])},{default:q(()=>[(S(),ae(vt(e.clearIcon)))]),_:1},8,["class","onClick"])):oe("v-if",!0),e.validateState&&e.validateIcon?(S(),ae(u,{key:2,class:E([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:q(()=>[(S(),ae(vt(e.validateIcon)))]),_:1},8,["class"])):oe("v-if",!0)],2)],2)]),content:q(()=>[z(c,{ref:"menuRef",data:e.filteredOptions,width:e.popperSize,"hovering-index":e.states.hoveringIndex,"scrollbar-always-on":e.scrollbarAlwaysOn},{default:q(p=>[ve(e.$slots,"default",io(Xu(p)))]),empty:q(()=>[ve(e.$slots,"empty",{},()=>[I("p",{class:E(e.nsSelectV2.e("empty"))},ue(e.emptyText?e.emptyText:""),3)])]),_:3},8,["data","width","hovering-index","scrollbar-always-on"])]),_:3},8,["visible","teleported","popper-class","popper-options","effect","placement","transition","persistent","onBeforeShow"])],34)),[[f,e.handleClickOutside,e.popperRef]])}var Qi=Ne(MU,[["render",LU],["__file","/home/runner/work/element-plus/element-plus/packages/components/select-v2/src/select.vue"]]);Qi.install=e=>{e.component(Qi.name,Qi)};const DU=Qi,BU=DU,FU=Me({animated:{type:Boolean,default:!1},count:{type:Number,default:1},rows:{type:Number,default:3},loading:{type:Boolean,default:!0},throttle:{type:Number}}),VU=Me({variant:{type:String,values:["circle","rect","h1","h3","text","caption","p","image","button"],default:"text"}}),zU=G({name:"ElSkeletonItem"}),HU=G({...zU,props:VU,setup(e){const t=ye("skeleton");return(n,o)=>(S(),x("div",{class:E([i(t).e("item"),i(t).e(n.variant)])},[n.variant==="image"?(S(),ae(i(aR),{key:0})):oe("v-if",!0)],2))}});var xu=Ne(HU,[["__file","/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton-item.vue"]]);const KU=G({name:"ElSkeleton"}),jU=G({...KU,props:FU,setup(e,{expose:t}){const n=e,o=ye("skeleton"),r=y8(Lt(n,"loading"),n.throttle);return t({uiLoading:r}),(l,s)=>i(r)?(S(),x("div",pt({key:0,class:[i(o).b(),i(o).is("animated",l.animated)]},l.$attrs),[(S(!0),x(xe,null,lt(l.count,a=>(S(),x(xe,{key:a},[l.loading?ve(l.$slots,"template",{key:a},()=>[z(xu,{class:E(i(o).is("first")),variant:"p"},null,8,["class"]),(S(!0),x(xe,null,lt(l.rows,u=>(S(),ae(xu,{key:u,class:E([i(o).e("paragraph"),i(o).is("last",u===l.rows&&l.rows>1)]),variant:"p"},null,8,["class"]))),128))]):oe("v-if",!0)],64))),128))],16)):ve(l.$slots,"default",io(pt({key:1},l.$attrs)))}});var WU=Ne(jU,[["__file","/home/runner/work/element-plus/element-plus/packages/components/skeleton/src/skeleton.vue"]]);const UU=it(WU,{SkeletonItem:xu}),qU=jt(xu),h_=Symbol("sliderContextKey"),YU=Me({modelValue:{type:se([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:hn,inputSize:hn,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:se(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},label:{type:String,default:void 0},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:se(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:Cl,default:"top"},marks:{type:se(Object)},validateEvent:{type:Boolean,default:!0}}),ld=e=>Xe(e)||Ve(e)&&e.every(Xe),GU={[dt]:ld,[Cn]:ld,[At]:ld},XU=(e,t,n)=>{const o=N();return tt(async()=>{e.range?(Array.isArray(e.modelValue)?(t.firstValue=Math.max(e.min,e.modelValue[0]),t.secondValue=Math.min(e.max,e.modelValue[1])):(t.firstValue=e.min,t.secondValue=e.max),t.oldValue=[t.firstValue,t.secondValue]):(typeof e.modelValue!="number"||Number.isNaN(e.modelValue)?t.firstValue=e.min:t.firstValue=Math.min(e.max,Math.max(e.min,e.modelValue)),t.oldValue=t.firstValue),Vt(window,"resize",n),await Ke(),n()}),{sliderWrapper:o}},JU=e=>C(()=>e.marks?Object.keys(e.marks).map(Number.parseFloat).sort((n,o)=>n-o).filter(n=>n<=e.max&&n>=e.min).map(n=>({point:n,position:(n-e.min)*100/(e.max-e.min),mark:e.marks[n]})):[]),ZU=(e,t,n)=>{const{form:o,formItem:r}=Tn(),l=Pt(),s=N(),a=N(),u={firstButton:s,secondButton:a},c=C(()=>e.disabled||(o==null?void 0:o.disabled)||!1),d=C(()=>Math.min(t.firstValue,t.secondValue)),f=C(()=>Math.max(t.firstValue,t.secondValue)),p=C(()=>e.range?`${100*(f.value-d.value)/(e.max-e.min)}%`:`${100*(t.firstValue-e.min)/(e.max-e.min)}%`),v=C(()=>e.range?`${100*(d.value-e.min)/(e.max-e.min)}%`:"0%"),m=C(()=>e.vertical?{height:e.height}:{}),h=C(()=>e.vertical?{height:p.value,bottom:v.value}:{width:p.value,left:v.value}),g=()=>{l.value&&(t.sliderSize=l.value[`client${e.vertical?"Height":"Width"}`])},y=V=>{const B=e.min+V*(e.max-e.min)/100;if(!e.range)return s;let D;return Math.abs(d.value-B)t.secondValue?"firstButton":"secondButton",u[D]},w=V=>{const B=y(V);return B.value.setPosition(V),B},b=V=>{t.firstValue=V,k(e.range?[d.value,f.value]:V)},_=V=>{t.secondValue=V,e.range&&k([d.value,f.value])},k=V=>{n(dt,V),n(Cn,V)},$=async()=>{await Ke(),n(At,e.range?[d.value,f.value]:e.modelValue)},M=V=>{var B,D,H,W,F,T;if(c.value||t.dragging)return;g();let L=0;if(e.vertical){const R=(H=(D=(B=V.touches)==null?void 0:B.item(0))==null?void 0:D.clientY)!=null?H:V.clientY;L=(l.value.getBoundingClientRect().bottom-R)/t.sliderSize*100}else{const R=(T=(F=(W=V.touches)==null?void 0:W.item(0))==null?void 0:F.clientX)!=null?T:V.clientX,U=l.value.getBoundingClientRect().left;L=(R-U)/t.sliderSize*100}if(!(L<0||L>100))return w(L)};return{elFormItem:r,slider:l,firstButton:s,secondButton:a,sliderDisabled:c,minValue:d,maxValue:f,runwayStyle:m,barStyle:h,resetSize:g,setPosition:w,emitChange:$,onSliderWrapperPrevent:V=>{var B,D;((B=u.firstButton.value)!=null&&B.dragging||(D=u.secondButton.value)!=null&&D.dragging)&&V.preventDefault()},onSliderClick:V=>{M(V)&&$()},onSliderDown:async V=>{const B=M(V);B&&(await Ke(),B.value.onButtonDown(V))},setFirstValue:b,setSecondValue:_}},{left:QU,down:eq,right:tq,up:nq,home:oq,end:rq,pageUp:lq,pageDown:sq}=We,aq=(e,t,n)=>{const o=N(),r=N(!1),l=C(()=>t.value instanceof Function),s=C(()=>l.value&&t.value(e.modelValue)||e.modelValue),a=$n(()=>{n.value&&(r.value=!0)},50),u=$n(()=>{n.value&&(r.value=!1)},50);return{tooltip:o,tooltipVisible:r,formatValue:s,displayTooltip:a,hideTooltip:u}},iq=(e,t,n)=>{const{disabled:o,min:r,max:l,step:s,showTooltip:a,precision:u,sliderSize:c,formatTooltip:d,emitChange:f,resetSize:p,updateDragging:v}=De(h_),{tooltip:m,tooltipVisible:h,formatValue:g,displayTooltip:y,hideTooltip:w}=aq(e,d,a),b=N(),_=C(()=>`${(e.modelValue-r.value)/(l.value-r.value)*100}%`),k=C(()=>e.vertical?{bottom:_.value}:{left:_.value}),$=()=>{t.hovering=!0,y()},M=()=>{t.hovering=!1,t.dragging||w()},O=j=>{o.value||(j.preventDefault(),L(j),window.addEventListener("mousemove",R),window.addEventListener("touchmove",R),window.addEventListener("mouseup",U),window.addEventListener("touchend",U),window.addEventListener("contextmenu",U),b.value.focus())},P=j=>{o.value||(t.newPosition=Number.parseFloat(_.value)+j/(l.value-r.value)*100,ne(t.newPosition),f())},A=()=>{P(-s.value)},V=()=>{P(s.value)},B=()=>{P(-s.value*4)},D=()=>{P(s.value*4)},H=()=>{o.value||(ne(0),f())},W=()=>{o.value||(ne(100),f())},F=j=>{let Q=!0;[QU,eq].includes(j.key)?A():[tq,nq].includes(j.key)?V():j.key===oq?H():j.key===rq?W():j.key===sq?B():j.key===lq?D():Q=!1,Q&&j.preventDefault()},T=j=>{let Q,he;return j.type.startsWith("touch")?(he=j.touches[0].clientY,Q=j.touches[0].clientX):(he=j.clientY,Q=j.clientX),{clientX:Q,clientY:he}},L=j=>{t.dragging=!0,t.isClick=!0;const{clientX:Q,clientY:he}=T(j);e.vertical?t.startY=he:t.startX=Q,t.startPosition=Number.parseFloat(_.value),t.newPosition=t.startPosition},R=j=>{if(t.dragging){t.isClick=!1,y(),p();let Q;const{clientX:he,clientY:ee}=T(j);e.vertical?(t.currentY=ee,Q=(t.startY-t.currentY)/c.value*100):(t.currentX=he,Q=(t.currentX-t.startX)/c.value*100),t.newPosition=t.startPosition+Q,ne(t.newPosition)}},U=()=>{t.dragging&&(setTimeout(()=>{t.dragging=!1,t.hovering||w(),t.isClick||ne(t.newPosition),f()},0),window.removeEventListener("mousemove",R),window.removeEventListener("touchmove",R),window.removeEventListener("mouseup",U),window.removeEventListener("touchend",U),window.removeEventListener("contextmenu",U))},ne=async j=>{if(j===null||Number.isNaN(+j))return;j<0?j=0:j>100&&(j=100);const Q=100/((l.value-r.value)/s.value);let ee=Math.round(j/Q)*Q*(l.value-r.value)*.01+r.value;ee=Number.parseFloat(ee.toFixed(u.value)),ee!==e.modelValue&&n(dt,ee),!t.dragging&&e.modelValue!==t.oldValue&&(t.oldValue=e.modelValue),await Ke(),t.dragging&&y(),m.value.updatePopper()};return me(()=>t.dragging,j=>{v(j)}),{disabled:o,button:b,tooltip:m,tooltipVisible:h,showTooltip:a,wrapperStyle:k,formatValue:g,handleMouseEnter:$,handleMouseLeave:M,onButtonDown:O,onKeyDown:F,setPosition:ne}},uq=(e,t,n,o)=>({stops:C(()=>{if(!e.showStops||e.min>e.max)return[];if(e.step===0)return[];const s=(e.max-e.min)/e.step,a=100*e.step/(e.max-e.min),u=Array.from({length:s-1}).map((c,d)=>(d+1)*a);return e.range?u.filter(c=>c<100*(n.value-e.min)/(e.max-e.min)||c>100*(o.value-e.min)/(e.max-e.min)):u.filter(c=>c>100*(t.firstValue-e.min)/(e.max-e.min))}),getStopStyle:s=>e.vertical?{bottom:`${s}%`}:{left:`${s}%`}}),cq=(e,t,n,o,r,l)=>{const s=c=>{r(dt,c),r(Cn,c)},a=()=>e.range?![n.value,o.value].every((c,d)=>c===t.oldValue[d]):e.modelValue!==t.oldValue,u=()=>{var c,d;e.min>e.max&&en("Slider","min should not be greater than max.");const f=e.modelValue;e.range&&Array.isArray(f)?f[1]e.max?s([e.max,e.max]):f[0]e.max?s([f[0],e.max]):(t.firstValue=f[0],t.secondValue=f[1],a()&&(e.validateEvent&&((c=l==null?void 0:l.validate)==null||c.call(l,"change").catch(p=>void 0)),t.oldValue=f.slice())):!e.range&&typeof f=="number"&&!Number.isNaN(f)&&(fe.max?s(e.max):(t.firstValue=f,a()&&(e.validateEvent&&((d=l==null?void 0:l.validate)==null||d.call(l,"change").catch(p=>void 0)),t.oldValue=f)))};u(),me(()=>t.dragging,c=>{c||u()}),me(()=>e.modelValue,(c,d)=>{t.dragging||Array.isArray(c)&&Array.isArray(d)&&c.every((f,p)=>f===d[p])&&t.firstValue===c[0]&&t.secondValue===c[1]||u()},{deep:!0}),me(()=>[e.min,e.max],()=>{u()})},dq=Me({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:Cl,default:"top"}}),fq={[dt]:e=>Xe(e)},pq=["tabindex"],hq=G({name:"ElSliderButton"}),vq=G({...hq,props:dq,emits:fq,setup(e,{expose:t,emit:n}){const o=e,r=ye("slider"),l=yt({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:o.modelValue}),{disabled:s,button:a,tooltip:u,showTooltip:c,tooltipVisible:d,wrapperStyle:f,formatValue:p,handleMouseEnter:v,handleMouseLeave:m,onButtonDown:h,onKeyDown:g,setPosition:y}=iq(o,l,n),{hovering:w,dragging:b}=Qt(l);return t({onButtonDown:h,onKeyDown:g,setPosition:y,hovering:w,dragging:b}),(_,k)=>(S(),x("div",{ref_key:"button",ref:a,class:E([i(r).e("button-wrapper"),{hover:i(w),dragging:i(b)}]),style:He(i(f)),tabindex:i(s)?-1:0,onMouseenter:k[0]||(k[0]=(...$)=>i(v)&&i(v)(...$)),onMouseleave:k[1]||(k[1]=(...$)=>i(m)&&i(m)(...$)),onMousedown:k[2]||(k[2]=(...$)=>i(h)&&i(h)(...$)),onTouchstart:k[3]||(k[3]=(...$)=>i(h)&&i(h)(...$)),onFocus:k[4]||(k[4]=(...$)=>i(v)&&i(v)(...$)),onBlur:k[5]||(k[5]=(...$)=>i(m)&&i(m)(...$)),onKeydown:k[6]||(k[6]=(...$)=>i(g)&&i(g)(...$))},[z(i(En),{ref_key:"tooltip",ref:u,visible:i(d),placement:_.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":_.tooltipClass,disabled:!i(c),persistent:""},{content:q(()=>[I("span",null,ue(i(p)),1)]),default:q(()=>[I("div",{class:E([i(r).e("button"),{hover:i(w),dragging:i(b)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,pq))}});var ly=Ne(vq,[["__file","/home/runner/work/element-plus/element-plus/packages/components/slider/src/button.vue"]]);const mq=Me({mark:{type:se([String,Object]),default:void 0}});var gq=G({name:"ElSliderMarker",props:mq,setup(e){const t=ye("slider"),n=C(()=>Ze(e.mark)?e.mark:e.mark.label),o=C(()=>Ze(e.mark)?void 0:e.mark.style);return()=>je("div",{class:t.e("marks-text"),style:o.value},n.value)}});const yq=["id","role","aria-label","aria-labelledby"],bq={key:1},wq=G({name:"ElSlider"}),_q=G({...wq,props:YU,emits:GU,setup(e,{expose:t,emit:n}){const o=e,r=ye("slider"),{t:l}=Ct(),s=yt({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:a,slider:u,firstButton:c,secondButton:d,sliderDisabled:f,minValue:p,maxValue:v,runwayStyle:m,barStyle:h,resetSize:g,emitChange:y,onSliderWrapperPrevent:w,onSliderClick:b,onSliderDown:_,setFirstValue:k,setSecondValue:$}=ZU(o,s,n),{stops:M,getStopStyle:O}=uq(o,s,p,v),{inputId:P,isLabeledByFormItem:A}=Fr(o,{formItemContext:a}),V=Jt(),B=C(()=>o.inputSize||V.value),D=C(()=>o.label||l("el.slider.defaultLabel",{min:o.min,max:o.max})),H=C(()=>o.range?o.rangeStartLabel||l("el.slider.defaultRangeStartLabel"):D.value),W=C(()=>o.formatValueText?o.formatValueText(j.value):`${j.value}`),F=C(()=>o.rangeEndLabel||l("el.slider.defaultRangeEndLabel")),T=C(()=>o.formatValueText?o.formatValueText(Q.value):`${Q.value}`),L=C(()=>[r.b(),r.m(V.value),r.is("vertical",o.vertical),{[r.m("with-input")]:o.showInput}]),R=JU(o);cq(o,s,p,v,n,a);const U=C(()=>{const Z=[o.min,o.max,o.step].map(te=>{const X=`${te}`.split(".")[1];return X?X.length:0});return Math.max.apply(null,Z)}),{sliderWrapper:ne}=XU(o,s,g),{firstValue:j,secondValue:Q,sliderSize:he}=Qt(s),ee=Z=>{s.dragging=Z};return ht(h_,{...Qt(o),sliderSize:he,disabled:f,precision:U,emitChange:y,resetSize:g,updateDragging:ee}),t({onSliderClick:b}),(Z,te)=>{var X,le;return S(),x("div",{id:Z.range?i(P):void 0,ref_key:"sliderWrapper",ref:ne,class:E(i(L)),role:Z.range?"group":void 0,"aria-label":Z.range&&!i(A)?i(D):void 0,"aria-labelledby":Z.range&&i(A)?(X=i(a))==null?void 0:X.labelId:void 0,onTouchstart:te[2]||(te[2]=(...de)=>i(w)&&i(w)(...de)),onTouchmove:te[3]||(te[3]=(...de)=>i(w)&&i(w)(...de))},[I("div",{ref_key:"slider",ref:u,class:E([i(r).e("runway"),{"show-input":Z.showInput&&!Z.range},i(r).is("disabled",i(f))]),style:He(i(m)),onMousedown:te[0]||(te[0]=(...de)=>i(_)&&i(_)(...de)),onTouchstart:te[1]||(te[1]=(...de)=>i(_)&&i(_)(...de))},[I("div",{class:E(i(r).e("bar")),style:He(i(h))},null,6),z(ly,{id:Z.range?void 0:i(P),ref_key:"firstButton",ref:c,"model-value":i(j),vertical:Z.vertical,"tooltip-class":Z.tooltipClass,placement:Z.placement,role:"slider","aria-label":Z.range||!i(A)?i(H):void 0,"aria-labelledby":!Z.range&&i(A)?(le=i(a))==null?void 0:le.labelId:void 0,"aria-valuemin":Z.min,"aria-valuemax":Z.range?i(Q):Z.max,"aria-valuenow":i(j),"aria-valuetext":i(W),"aria-orientation":Z.vertical?"vertical":"horizontal","aria-disabled":i(f),"onUpdate:modelValue":i(k)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),Z.range?(S(),ae(ly,{key:0,ref_key:"secondButton",ref:d,"model-value":i(Q),vertical:Z.vertical,"tooltip-class":Z.tooltipClass,placement:Z.placement,role:"slider","aria-label":i(F),"aria-valuemin":i(j),"aria-valuemax":Z.max,"aria-valuenow":i(Q),"aria-valuetext":i(T),"aria-orientation":Z.vertical?"vertical":"horizontal","aria-disabled":i(f),"onUpdate:modelValue":i($)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):oe("v-if",!0),Z.showStops?(S(),x("div",bq,[(S(!0),x(xe,null,lt(i(M),(de,Ie)=>(S(),x("div",{key:Ie,class:E(i(r).e("stop")),style:He(i(O)(de))},null,6))),128))])):oe("v-if",!0),i(R).length>0?(S(),x(xe,{key:2},[I("div",null,[(S(!0),x(xe,null,lt(i(R),(de,Ie)=>(S(),x("div",{key:Ie,style:He(i(O)(de.position)),class:E([i(r).e("stop"),i(r).e("marks-stop")])},null,6))),128))]),I("div",{class:E(i(r).e("marks"))},[(S(!0),x(xe,null,lt(i(R),(de,Ie)=>(S(),ae(i(gq),{key:Ie,mark:de.mark,style:He(i(O)(de.position))},null,8,["mark","style"]))),128))],2)],64)):oe("v-if",!0)],38),Z.showInput&&!Z.range?(S(),ae(i(V2),{key:0,ref:"input","model-value":i(j),class:E(i(r).e("input")),step:Z.step,disabled:i(f),controls:Z.showInputControls,min:Z.min,max:Z.max,debounce:Z.debounce,size:i(B),"onUpdate:modelValue":i(k),onChange:i(y)},null,8,["model-value","class","step","disabled","controls","min","max","debounce","size","onUpdate:modelValue","onChange"])):oe("v-if",!0)],42,yq)}}});var Cq=Ne(_q,[["__file","/home/runner/work/element-plus/element-plus/packages/components/slider/src/slider.vue"]]);const Sq=it(Cq),kq=Me({prefixCls:{type:String}}),sy=G({name:"ElSpaceItem",props:kq,setup(e,{slots:t}){const n=ye("space"),o=C(()=>`${e.prefixCls||n.b()}__item`);return()=>je("div",{class:o.value},ve(t,"default"))}}),ay={small:8,default:12,large:16};function $q(e){const t=ye("space"),n=C(()=>[t.b(),t.m(e.direction),e.class]),o=N(0),r=N(0),l=C(()=>{const a=e.wrap||e.fill?{flexWrap:"wrap",marginBottom:`-${r.value}px`}:{},u={alignItems:e.alignment};return[a,u,e.style]}),s=C(()=>{const a={paddingBottom:`${r.value}px`,marginRight:`${o.value}px`},u=e.fill?{flexGrow:1,minWidth:`${e.fillRatio}%`}:{};return[a,u]});return Kn(()=>{const{size:a="small",wrap:u,direction:c,fill:d}=e;if(Ve(a)){const[f=0,p=0]=a;o.value=f,r.value=p}else{let f;Xe(a)?f=a:f=ay[a||"small"]||ay.small,(u||d)&&c==="horizontal"?o.value=r.value=f:c==="horizontal"?(o.value=f,r.value=0):(r.value=f,o.value=0)}}),{classes:n,containerStyle:l,itemStyle:s}}const Eq=Me({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:se([String,Object,Array]),default:""},style:{type:se([String,Array,Object]),default:""},alignment:{type:se(String),default:"center"},prefixCls:{type:String},spacer:{type:se([Object,String,Number,Array]),default:null,validator:e=>zt(e)||Xe(e)||Ze(e)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:Lo,validator:e=>Xe(e)||Ve(e)&&e.length===2&&e.every(Xe)}}),Tq=G({name:"ElSpace",props:Eq,setup(e,{slots:t}){const{classes:n,containerStyle:o,itemStyle:r}=$q(e);function l(s,a="",u=[]){const{prefixCls:c}=e;return s.forEach((d,f)=>{Fd(d)?Ve(d.children)&&d.children.forEach((p,v)=>{Fd(p)&&Ve(p.children)?l(p.children,`${a+v}-`,u):u.push(z(sy,{style:r.value,prefixCls:c,key:`nested-${a+v}`},{default:()=>[p]},qn.PROPS|qn.STYLE,["style","prefixCls"]))}):tx(d)&&u.push(z(sy,{style:r.value,prefixCls:c,key:`LoopKey${a+f}`},{default:()=>[d]},qn.PROPS|qn.STYLE,["style","prefixCls"]))}),u}return()=>{var s;const{spacer:a,direction:u}=e,c=ve(t,"default",{key:0},()=>[]);if(((s=c.children)!=null?s:[]).length===0)return null;if(Ve(c.children)){let d=l(c.children);if(a){const f=d.length-1;d=d.reduce((p,v,m)=>{const h=[...p,v];return m!==f&&h.push(z("span",{style:[r.value,u==="vertical"?"width: 100%":null],key:m},[zt(a)?a:nt(a,qn.TEXT)],qn.STYLE)),h},[])}return z("div",{class:n.value,style:o.value},d,qn.STYLE|qn.CLASS)}return c.children}}}),Oq=it(Tq),Nq=Me({decimalSeparator:{type:String,default:"."},groupSeparator:{type:String,default:","},precision:{type:Number,default:0},formatter:Function,value:{type:se([Number,Object]),default:0},prefix:String,suffix:String,title:String,valueStyle:{type:se([String,Object,Array])}}),Mq=G({name:"ElStatistic"}),Iq=G({...Mq,props:Nq,setup(e,{expose:t}){const n=e,o=ye("statistic"),r=C(()=>{const{value:l,formatter:s,precision:a,decimalSeparator:u,groupSeparator:c}=n;if(Je(s))return s(l);if(!Xe(l))return l;let[d,f=""]=String(l).split(".");return f=f.padEnd(a,"0").slice(0,a>0?a:0),d=d.replace(/\B(?=(\d{3})+(?!\d))/g,c),[d,f].join(f?u:"")});return t({displayValue:r}),(l,s)=>(S(),x("div",{class:E(i(o).b())},[l.$slots.title||l.title?(S(),x("div",{key:0,class:E(i(o).e("head"))},[ve(l.$slots,"title",{},()=>[nt(ue(l.title),1)])],2)):oe("v-if",!0),I("div",{class:E(i(o).e("content"))},[l.$slots.prefix||l.prefix?(S(),x("div",{key:0,class:E(i(o).e("prefix"))},[ve(l.$slots,"prefix",{},()=>[I("span",null,ue(l.prefix),1)])],2)):oe("v-if",!0),I("span",{class:E(i(o).e("number")),style:He(l.valueStyle)},ue(i(r)),7),l.$slots.suffix||l.suffix?(S(),x("div",{key:1,class:E(i(o).e("suffix"))},[ve(l.$slots,"suffix",{},()=>[I("span",null,ue(l.suffix),1)])],2)):oe("v-if",!0)],2)],2))}});var Pq=Ne(Iq,[["__file","/home/runner/work/element-plus/element-plus/packages/components/statistic/src/statistic.vue"]]);const v_=it(Pq),Rq=Me({format:{type:String,default:"HH:mm:ss"},prefix:String,suffix:String,title:String,value:{type:se([Number,Object]),default:0},valueStyle:{type:se([String,Object,Array])}}),Aq={finish:()=>!0,[At]:e=>Xe(e)},xq=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]],iy=e=>Xe(e)?new Date(e).getTime():e.valueOf(),uy=(e,t)=>{let n=e;const o=/\[([^\]]*)]/g;return xq.reduce((l,[s,a])=>{const u=new RegExp(`${s}+(?![^\\[\\]]*\\])`,"g");if(u.test(l)){const c=Math.floor(n/a);return n-=c*a,l.replace(u,d=>String(c).padStart(d.length,"0"))}return l},t).replace(o,"$1")},Lq=G({name:"ElCountdown"}),Dq=G({...Lq,props:Rq,emits:Aq,setup(e,{expose:t,emit:n}){const o=e;let r;const l=N(iy(o.value)-Date.now()),s=C(()=>uy(l.value,o.format)),a=d=>uy(d,o.format),u=()=>{r&&(dc(r),r=void 0)},c=()=>{const d=iy(o.value),f=()=>{let p=d-Date.now();n("change",p),p<=0?(p=0,u(),n("finish")):r=wa(f),l.value=p};r=wa(f)};return me(()=>[o.value,o.format],()=>{u(),c()},{immediate:!0}),Dt(()=>{u()}),t({displayValue:s}),(d,f)=>(S(),ae(i(v_),{value:l.value,title:d.title,prefix:d.prefix,suffix:d.suffix,"value-style":d.valueStyle,formatter:a},Xo({_:2},[lt(d.$slots,(p,v)=>({name:v,fn:q(()=>[ve(d.$slots,v)])}))]),1032,["value","title","prefix","suffix","value-style"]))}});var Bq=Ne(Dq,[["__file","/home/runner/work/element-plus/element-plus/packages/components/countdown/src/countdown.vue"]]);const Fq=it(Bq),Vq=Me({space:{type:[Number,String],default:""},active:{type:Number,default:0},direction:{type:String,default:"horizontal",values:["horizontal","vertical"]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:["wait","process","finish","error","success"],default:"finish"},processStatus:{type:String,values:["wait","process","finish","error","success"],default:"process"}}),zq={[At]:(e,t)=>[e,t].every(Xe)},Hq=G({name:"ElSteps"}),Kq=G({...Hq,props:Vq,emits:zq,setup(e,{emit:t}){const n=e,o=ye("steps"),r=N([]);return me(r,()=>{r.value.forEach((l,s)=>{l.setIndex(s)})}),ht("ElSteps",{props:n,steps:r}),me(()=>n.active,(l,s)=>{t(At,l,s)}),(l,s)=>(S(),x("div",{class:E([i(o).b(),i(o).m(l.simple?"simple":l.direction)])},[ve(l.$slots,"default")],2))}});var jq=Ne(Kq,[["__file","/home/runner/work/element-plus/element-plus/packages/components/steps/src/steps.vue"]]);const Wq=Me({title:{type:String,default:""},icon:{type:Rt},description:{type:String,default:""},status:{type:String,values:["","wait","process","finish","error","success"],default:""}}),Uq=G({name:"ElStep"}),qq=G({...Uq,props:Wq,setup(e){const t=e,n=ye("step"),o=N(-1),r=N({}),l=N(""),s=De("ElSteps"),a=ut();tt(()=>{me([()=>s.props.active,()=>s.props.processStatus,()=>s.props.finishStatus],([k])=>{b(k)},{immediate:!0})}),Dt(()=>{s.steps.value=s.steps.value.filter(k=>k.uid!==(a==null?void 0:a.uid))});const u=C(()=>t.status||l.value),c=C(()=>{const k=s.steps.value[o.value-1];return k?k.currentStatus:"wait"}),d=C(()=>s.props.alignCenter),f=C(()=>s.props.direction==="vertical"),p=C(()=>s.props.simple),v=C(()=>s.steps.value.length),m=C(()=>{var k;return((k=s.steps.value[v.value-1])==null?void 0:k.uid)===(a==null?void 0:a.uid)}),h=C(()=>p.value?"":s.props.space),g=C(()=>{const k={flexBasis:Xe(h.value)?`${h.value}px`:h.value?h.value:`${100/(v.value-(d.value?0:1))}%`};return f.value||m.value&&(k.maxWidth=`${100/v.value}%`),k}),y=k=>{o.value=k},w=k=>{const $=k==="wait",M={transitionDelay:`${$?"-":""}${150*o.value}ms`},O=k===s.props.processStatus||$?0:100;M.borderWidth=O&&!p.value?"1px":0,M[s.props.direction==="vertical"?"height":"width"]=`${O}%`,r.value=M},b=k=>{k>o.value?l.value=s.props.finishStatus:k===o.value&&c.value!=="error"?l.value=s.props.processStatus:l.value="wait";const $=s.steps.value[o.value-1];$&&$.calcProgress(l.value)},_=yt({uid:C(()=>a==null?void 0:a.uid),currentStatus:u,setIndex:y,calcProgress:w});return s.steps.value=[...s.steps.value,_],(k,$)=>(S(),x("div",{style:He(i(g)),class:E([i(n).b(),i(n).is(i(p)?"simple":i(s).props.direction),i(n).is("flex",i(m)&&!i(h)&&!i(d)),i(n).is("center",i(d)&&!i(f)&&!i(p))])},[oe(" icon & line "),I("div",{class:E([i(n).e("head"),i(n).is(i(u))])},[i(p)?oe("v-if",!0):(S(),x("div",{key:0,class:E(i(n).e("line"))},[I("i",{class:E(i(n).e("line-inner")),style:He(r.value)},null,6)],2)),I("div",{class:E([i(n).e("icon"),i(n).is(k.icon||k.$slots.icon?"icon":"text")])},[ve(k.$slots,"icon",{},()=>[k.icon?(S(),ae(i(ze),{key:0,class:E(i(n).e("icon-inner"))},{default:q(()=>[(S(),ae(vt(k.icon)))]),_:1},8,["class"])):i(u)==="success"?(S(),ae(i(ze),{key:1,class:E([i(n).e("icon-inner"),i(n).is("status")])},{default:q(()=>[z(i(Ja))]),_:1},8,["class"])):i(u)==="error"?(S(),ae(i(ze),{key:2,class:E([i(n).e("icon-inner"),i(n).is("status")])},{default:q(()=>[z(i(vo))]),_:1},8,["class"])):i(p)?oe("v-if",!0):(S(),x("div",{key:3,class:E(i(n).e("icon-inner"))},ue(o.value+1),3))])],2)],2),oe(" title & description "),I("div",{class:E(i(n).e("main"))},[I("div",{class:E([i(n).e("title"),i(n).is(i(u))])},[ve(k.$slots,"title",{},()=>[nt(ue(k.title),1)])],2),i(p)?(S(),x("div",{key:0,class:E(i(n).e("arrow"))},null,2)):(S(),x("div",{key:1,class:E([i(n).e("description"),i(n).is(i(u))])},[ve(k.$slots,"description",{},()=>[nt(ue(k.description),1)])],2))],2)],6))}});var m_=Ne(qq,[["__file","/home/runner/work/element-plus/element-plus/packages/components/steps/src/item.vue"]]);const Yq=it(jq,{Step:m_}),Gq=jt(m_),Xq=Me({modelValue:{type:[Boolean,String,Number],default:!1},value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},inlinePrompt:{type:Boolean,default:!1},activeIcon:{type:Rt},inactiveIcon:{type:Rt},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},borderColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String,loading:{type:Boolean,default:!1},beforeChange:{type:se(Function)},size:{type:String,validator:uc},tabindex:{type:[String,Number]}}),Jq={[dt]:e=>Xt(e)||Ze(e)||Xe(e),[At]:e=>Xt(e)||Ze(e)||Xe(e),[Cn]:e=>Xt(e)||Ze(e)||Xe(e)},Zq=["onClick"],Qq=["id","aria-checked","aria-disabled","name","true-value","false-value","disabled","tabindex","onKeydown"],eY=["aria-hidden"],tY=["aria-hidden"],nY=["aria-hidden"],Rf="ElSwitch",oY=G({name:Rf}),rY=G({...oY,props:Xq,emits:Jq,setup(e,{expose:t,emit:n}){const o=e,r=ut(),{formItem:l}=Tn(),s=Jt(),a=ye("switch");Ro({from:'"value"',replacement:'"model-value" or "v-model"',scope:Rf,version:"2.3.0",ref:"https://element-plus.org/en-US/component/switch.html#attributes",type:"Attribute"},C(()=>{var k;return!!((k=r.vnode.props)!=null&&k.value)}));const{inputId:u}=Fr(o,{formItemContext:l}),c=xn(C(()=>o.loading)),d=N(o.modelValue!==!1),f=N(),p=N(),v=C(()=>[a.b(),a.m(s.value),a.is("disabled",c.value),a.is("checked",g.value)]),m=C(()=>({width:qt(o.width)}));me(()=>o.modelValue,()=>{d.value=!0}),me(()=>o.value,()=>{d.value=!1});const h=C(()=>d.value?o.modelValue:o.value),g=C(()=>h.value===o.activeValue);[o.activeValue,o.inactiveValue].includes(h.value)||(n(dt,o.inactiveValue),n(At,o.inactiveValue),n(Cn,o.inactiveValue)),me(g,k=>{var $;f.value.checked=k,o.validateEvent&&(($=l==null?void 0:l.validate)==null||$.call(l,"change").catch(M=>void 0))});const y=()=>{const k=g.value?o.inactiveValue:o.activeValue;n(dt,k),n(At,k),n(Cn,k),Ke(()=>{f.value.checked=g.value})},w=()=>{if(c.value)return;const{beforeChange:k}=o;if(!k){y();return}const $=k();[oa($),Xt($)].includes(!0)||en(Rf,"beforeChange must return type `Promise` or `boolean`"),oa($)?$.then(O=>{O&&y()}).catch(O=>{}):$&&y()},b=C(()=>a.cssVarBlock({...o.activeColor?{"on-color":o.activeColor}:null,...o.inactiveColor?{"off-color":o.inactiveColor}:null,...o.borderColor?{"border-color":o.borderColor}:null})),_=()=>{var k,$;($=(k=f.value)==null?void 0:k.focus)==null||$.call(k)};return tt(()=>{f.value.checked=g.value}),t({focus:_,checked:g}),(k,$)=>(S(),x("div",{class:E(i(v)),style:He(i(b)),onClick:Ge(w,["prevent"])},[I("input",{id:i(u),ref_key:"input",ref:f,class:E(i(a).e("input")),type:"checkbox",role:"switch","aria-checked":i(g),"aria-disabled":i(c),name:k.name,"true-value":k.activeValue,"false-value":k.inactiveValue,disabled:i(c),tabindex:k.tabindex,onChange:y,onKeydown:wt(w,["enter"])},null,42,Qq),!k.inlinePrompt&&(k.inactiveIcon||k.inactiveText)?(S(),x("span",{key:0,class:E([i(a).e("label"),i(a).em("label","left"),i(a).is("active",!i(g))])},[k.inactiveIcon?(S(),ae(i(ze),{key:0},{default:q(()=>[(S(),ae(vt(k.inactiveIcon)))]),_:1})):oe("v-if",!0),!k.inactiveIcon&&k.inactiveText?(S(),x("span",{key:1,"aria-hidden":i(g)},ue(k.inactiveText),9,eY)):oe("v-if",!0)],2)):oe("v-if",!0),I("span",{ref_key:"core",ref:p,class:E(i(a).e("core")),style:He(i(m))},[k.inlinePrompt?(S(),x("div",{key:0,class:E(i(a).e("inner"))},[k.activeIcon||k.inactiveIcon?(S(),ae(i(ze),{key:0,class:E(i(a).is("icon"))},{default:q(()=>[(S(),ae(vt(i(g)?k.activeIcon:k.inactiveIcon)))]),_:1},8,["class"])):k.activeText||k.inactiveText?(S(),x("span",{key:1,class:E(i(a).is("text")),"aria-hidden":!i(g)},ue(i(g)?k.activeText:k.inactiveText),11,tY)):oe("v-if",!0)],2)):oe("v-if",!0),I("div",{class:E(i(a).e("action"))},[k.loading?(S(),ae(i(ze),{key:0,class:E(i(a).is("loading"))},{default:q(()=>[z(i(Dr))]),_:1},8,["class"])):oe("v-if",!0)],2)],6),!k.inlinePrompt&&(k.activeIcon||k.activeText)?(S(),x("span",{key:1,class:E([i(a).e("label"),i(a).em("label","right"),i(a).is("active",i(g))])},[k.activeIcon?(S(),ae(i(ze),{key:0},{default:q(()=>[(S(),ae(vt(k.activeIcon)))]),_:1})):oe("v-if",!0),!k.activeIcon&&k.activeText?(S(),x("span",{key:1,"aria-hidden":!i(g)},ue(k.activeText),9,nY)):oe("v-if",!0)],2)):oe("v-if",!0)],14,Zq))}});var lY=Ne(rY,[["__file","/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);const sY=it(lY);/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var aY=/["'&<>]/,iY=uY;function uY(e){var t=""+e,n=aY.exec(t);if(!n)return t;var o,r="",l=0,s=0;for(l=n.index;ltypeof c=="string"?Bt(a,c):c(a,u,e))):(t!=="$key"&&ft(a)&&"$value"in a&&(a=a.$value),[ft(a)?Bt(a,t):a])},s=function(a,u){if(o)return o(a.value,u.value);for(let c=0,d=a.key.length;cu.key[c])return 1}return 0};return e.map((a,u)=>({value:a,index:u,key:l?l(a,u):null})).sort((a,u)=>{let c=s(a,u);return c||(c=a.index-u.index),c*+n}).map(a=>a.value)},g_=function(e,t){let n=null;return e.columns.forEach(o=>{o.id===t&&(n=o)}),n},dY=function(e,t){let n=null;for(let o=0;o{if(!e)throw new Error("Row is required when get row identity");if(typeof t=="string"){if(!t.includes("."))return`${e[t]}`;const n=t.split(".");let o=e;for(const r of n)o=o[r];return`${o}`}else if(typeof t=="function")return t.call(null,e)},ol=function(e,t){const n={};return(e||[]).forEach((o,r)=>{n[dn(o,t)]={row:o,index:r}}),n};function fY(e,t){const n={};let o;for(o in e)n[o]=e[o];for(o in t)if(gt(t,o)){const r=t[o];typeof r<"u"&&(n[o]=r)}return n}function Ph(e){return e===""||e!==void 0&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function y_(e){return e===""||e!==void 0&&(e=Ph(e),Number.isNaN(e)&&(e=80)),e}function pY(e){return typeof e=="number"?e:typeof e=="string"?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null}function hY(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Zs(e,t,n){let o=!1;const r=e.indexOf(t),l=r!==-1,s=a=>{a==="add"?e.push(t):e.splice(r,1),o=!0,Ve(t.children)&&t.children.forEach(u=>{Zs(e,u,n??!l)})};return Xt(n)?n&&!l?s("add"):!n&&l&&s("remove"):s(l?"remove":"add"),o}function vY(e,t,n="children",o="hasChildren"){const r=s=>!(Array.isArray(s)&&s.length);function l(s,a,u){t(s,a,u),a.forEach(c=>{if(c[o]){t(c,null,u+1);return}const d=c[n];r(d)||l(c,d,u+1)})}e.forEach(s=>{if(s[o]){t(s,null,0);return}const a=s[n];r(a)||l(s,a,0)})}let zo;function mY(e,t,n,o,r){r=Qb({enterable:!0,showArrow:!0},r);const l=e==null?void 0:e.dataset.prefix,s=e==null?void 0:e.querySelector(`.${l}-scrollbar__wrap`);function a(){const g=r.effect==="light",y=document.createElement("div");return y.className=[`${l}-popper`,g?"is-light":"is-dark",r.popperClass||""].join(" "),n=iY(n),y.innerHTML=n,y.style.zIndex=String(o()),e==null||e.appendChild(y),y}function u(){const g=document.createElement("div");return g.className=`${l}-popper__arrow`,g}function c(){d&&d.update()}zo==null||zo(),zo=()=>{try{d&&d.destroy(),v&&(e==null||e.removeChild(v)),t.removeEventListener("mouseenter",f),t.removeEventListener("mouseleave",p),s==null||s.removeEventListener("scroll",zo),zo=void 0}catch{}};let d=null,f=c,p=zo;r.enterable&&({onOpen:f,onClose:p}=D1({showAfter:r.showAfter,hideAfter:r.hideAfter,open:c,close:zo}));const v=a();v.onmouseenter=f,v.onmouseleave=p;const m=[];if(r.offset&&m.push({name:"offset",options:{offset:[0,r.offset]}}),r.showArrow){const g=v.appendChild(u());m.push({name:"arrow",options:{element:g,padding:10}})}const h=r.popperOptions||{};return d=A1(t,v,{placement:r.placement||"top",strategy:"fixed",...h,modifiers:h.modifiers?m.concat(h.modifiers):m}),t.addEventListener("mouseenter",f),t.addEventListener("mouseleave",p),s==null||s.addEventListener("scroll",zo),d}function b_(e){return e.children?xN(e.children,b_):[e]}function dy(e,t){return e+t.colSpan}const w_=(e,t,n,o)=>{let r=0,l=e;const s=n.states.columns.value;if(o){const u=b_(o[e]);r=s.slice(0,s.indexOf(u[0])).reduce(dy,0),l=r+u.reduce(dy,0)-1}else r=e;let a;switch(t){case"left":l=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right");break;default:l=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right")}return a?{direction:a,start:r,after:l}:{}},Rh=(e,t,n,o,r,l=0)=>{const s=[],{direction:a,start:u,after:c}=w_(t,n,o,r);if(a){const d=a==="left";s.push(`${e}-fixed-column--${a}`),d&&c+l===o.states.fixedLeafColumnsLength.value-1?s.push("is-last-column"):!d&&u-l===o.states.columns.value.length-o.states.rightFixedLeafColumnsLength.value&&s.push("is-first-column")}return s};function fy(e,t){return e+(t.realWidth===null||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const Ah=(e,t,n,o)=>{const{direction:r,start:l=0,after:s=0}=w_(e,t,n,o);if(!r)return;const a={},u=r==="left",c=n.states.columns.value;return u?a.left=c.slice(0,l).reduce(fy,0):a.right=c.slice(s+1).reverse().reduce(fy,0),a},ds=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))};function gY(e){const t=ut(),n=N(!1),o=N([]);return{updateExpandRows:()=>{const u=e.data.value||[],c=e.rowKey.value;if(n.value)o.value=u.slice();else if(c){const d=ol(o.value,c);o.value=u.reduce((f,p)=>{const v=dn(p,c);return d[v]&&f.push(p),f},[])}else o.value=[]},toggleRowExpansion:(u,c)=>{Zs(o.value,u,c)&&t.emit("expand-change",u,o.value.slice())},setExpandRowKeys:u=>{t.store.assertRowKey();const c=e.data.value||[],d=e.rowKey.value,f=ol(c,d);o.value=u.reduce((p,v)=>{const m=f[v];return m&&p.push(m.row),p},[])},isRowExpanded:u=>{const c=e.rowKey.value;return c?!!ol(o.value,c)[dn(u,c)]:o.value.includes(u)},states:{expandRows:o,defaultExpandAll:n}}}function yY(e){const t=ut(),n=N(null),o=N(null),r=c=>{t.store.assertRowKey(),n.value=c,s(c)},l=()=>{n.value=null},s=c=>{const{data:d,rowKey:f}=e;let p=null;f.value&&(p=(i(d)||[]).find(v=>dn(v,f.value)===c)),o.value=p,t.emit("current-change",o.value,null)};return{setCurrentRowKey:r,restoreCurrentRowKey:l,setCurrentRowByKey:s,updateCurrentRow:c=>{const d=o.value;if(c&&c!==d){o.value=c,t.emit("current-change",o.value,d);return}!c&&d&&(o.value=null,t.emit("current-change",null,d))},updateCurrentRowData:()=>{const c=e.rowKey.value,d=e.data.value||[],f=o.value;if(!d.includes(f)&&f){if(c){const p=dn(f,c);s(p)}else o.value=null;o.value===null&&t.emit("current-change",null,f)}else n.value&&(s(n.value),l())},states:{_currentRowKey:n,currentRow:o}}}function bY(e){const t=N([]),n=N({}),o=N(16),r=N(!1),l=N({}),s=N("hasChildren"),a=N("children"),u=ut(),c=C(()=>{if(!e.rowKey.value)return{};const y=e.data.value||[];return f(y)}),d=C(()=>{const y=e.rowKey.value,w=Object.keys(l.value),b={};return w.length&&w.forEach(_=>{if(l.value[_].length){const k={children:[]};l.value[_].forEach($=>{const M=dn($,y);k.children.push(M),$[s.value]&&!b[M]&&(b[M]={children:[]})}),b[_]=k}}),b}),f=y=>{const w=e.rowKey.value,b={};return vY(y,(_,k,$)=>{const M=dn(_,w);Array.isArray(k)?b[M]={children:k.map(O=>dn(O,w)),level:$}:r.value&&(b[M]={children:[],lazy:!0,level:$})},a.value,s.value),b},p=(y=!1,w=(b=>(b=u.store)==null?void 0:b.states.defaultExpandAll.value)())=>{var b;const _=c.value,k=d.value,$=Object.keys(_),M={};if($.length){const O=i(n),P=[],A=(B,D)=>{if(y)return t.value?w||t.value.includes(D):!!(w||B!=null&&B.expanded);{const H=w||t.value&&t.value.includes(D);return!!(B!=null&&B.expanded||H)}};$.forEach(B=>{const D=O[B],H={..._[B]};if(H.expanded=A(D,B),H.lazy){const{loaded:W=!1,loading:F=!1}=D||{};H.loaded=!!W,H.loading=!!F,P.push(B)}M[B]=H});const V=Object.keys(k);r.value&&V.length&&P.length&&V.forEach(B=>{const D=O[B],H=k[B].children;if(P.includes(B)){if(M[B].children.length!==0)throw new Error("[ElTable]children must be an empty array.");M[B].children=H}else{const{loaded:W=!1,loading:F=!1}=D||{};M[B]={lazy:!0,loaded:!!W,loading:!!F,expanded:A(D,B),children:H,level:""}}})}n.value=M,(b=u.store)==null||b.updateTableScrollY()};me(()=>t.value,()=>{p(!0)}),me(()=>c.value,()=>{p()}),me(()=>d.value,()=>{p()});const v=y=>{t.value=y,p()},m=(y,w)=>{u.store.assertRowKey();const b=e.rowKey.value,_=dn(y,b),k=_&&n.value[_];if(_&&k&&"expanded"in k){const $=k.expanded;w=typeof w>"u"?!k.expanded:w,n.value[_].expanded=w,$!==w&&u.emit("expand-change",y,w),u.store.updateTableScrollY()}},h=y=>{u.store.assertRowKey();const w=e.rowKey.value,b=dn(y,w),_=n.value[b];r.value&&_&&"loaded"in _&&!_.loaded?g(y,b,_):m(y,void 0)},g=(y,w,b)=>{const{load:_}=u.props;_&&!n.value[w].loaded&&(n.value[w].loading=!0,_(y,b,k=>{if(!Array.isArray(k))throw new TypeError("[ElTable] data must be an array");n.value[w].loading=!1,n.value[w].loaded=!0,n.value[w].expanded=!0,k.length&&(l.value[w]=k),u.emit("expand-change",y,!0)}))};return{loadData:g,loadOrToggle:h,toggleTreeExpansion:m,updateTreeExpandKeys:v,updateTreeData:p,normalize:f,states:{expandRowKeys:t,treeData:n,indent:o,lazy:r,lazyTreeNodeMap:l,lazyColumnIdentifier:s,childrenColumnName:a}}}const wY=(e,t)=>{const n=t.sortingColumn;return!n||typeof n.sortable=="string"?e:cY(e,t.sortProp,t.sortOrder,n.sortMethod,n.sortBy)},eu=e=>{const t=[];return e.forEach(n=>{n.children?t.push.apply(t,eu(n.children)):t.push(n)}),t};function _Y(){var e;const t=ut(),{size:n}=Qt((e=t.proxy)==null?void 0:e.$props),o=N(null),r=N([]),l=N([]),s=N(!1),a=N([]),u=N([]),c=N([]),d=N([]),f=N([]),p=N([]),v=N([]),m=N([]),h=[],g=N(0),y=N(0),w=N(0),b=N(!1),_=N([]),k=N(!1),$=N(!1),M=N(null),O=N({}),P=N(null),A=N(null),V=N(null),B=N(null),D=N(null);me(r,()=>t.state&&T(!1),{deep:!0});const H=()=>{if(!o.value)throw new Error("[ElTable] prop row-key is required")},W=ke=>{var ie;(ie=ke.children)==null||ie.forEach(Y=>{Y.fixed=ke.fixed,W(Y)})},F=()=>{a.value.forEach(Ce=>{W(Ce)}),d.value=a.value.filter(Ce=>Ce.fixed===!0||Ce.fixed==="left"),f.value=a.value.filter(Ce=>Ce.fixed==="right"),d.value.length>0&&a.value[0]&&a.value[0].type==="selection"&&!a.value[0].fixed&&(a.value[0].fixed=!0,d.value.unshift(a.value[0]));const ke=a.value.filter(Ce=>!Ce.fixed);u.value=[].concat(d.value).concat(ke).concat(f.value);const ie=eu(ke),Y=eu(d.value),re=eu(f.value);g.value=ie.length,y.value=Y.length,w.value=re.length,c.value=[].concat(Y).concat(ie).concat(re),s.value=d.value.length>0||f.value.length>0},T=(ke,ie=!1)=>{ke&&F(),ie?t.state.doLayout():t.state.debouncedUpdateLayout()},L=ke=>_.value.includes(ke),R=()=>{b.value=!1,_.value.length&&(_.value=[],t.emit("selection-change",[]))},U=()=>{let ke;if(o.value){ke=[];const ie=ol(_.value,o.value),Y=ol(r.value,o.value);for(const re in ie)gt(ie,re)&&!Y[re]&&ke.push(ie[re].row)}else ke=_.value.filter(ie=>!r.value.includes(ie));if(ke.length){const ie=_.value.filter(Y=>!ke.includes(Y));_.value=ie,t.emit("selection-change",ie.slice())}},ne=()=>(_.value||[]).slice(),j=(ke,ie=void 0,Y=!0)=>{if(Zs(_.value,ke,ie)){const Ce=(_.value||[]).slice();Y&&t.emit("select",Ce,ke),t.emit("selection-change",Ce)}},Q=()=>{var ke,ie;const Y=$.value?!b.value:!(b.value||_.value.length);b.value=Y;let re=!1,Ce=0;const Pe=(ie=(ke=t==null?void 0:t.store)==null?void 0:ke.states)==null?void 0:ie.rowKey.value;r.value.forEach((ot,we)=>{const Fe=we+Ce;M.value?M.value.call(null,ot,Fe)&&Zs(_.value,ot,Y)&&(re=!0):Zs(_.value,ot,Y)&&(re=!0),Ce+=Z(dn(ot,Pe))}),re&&t.emit("selection-change",_.value?_.value.slice():[]),t.emit("select-all",_.value)},he=()=>{const ke=ol(_.value,o.value);r.value.forEach(ie=>{const Y=dn(ie,o.value),re=ke[Y];re&&(_.value[re.index]=ie)})},ee=()=>{var ke,ie,Y;if(((ke=r.value)==null?void 0:ke.length)===0){b.value=!1;return}let re;o.value&&(re=ol(_.value,o.value));const Ce=function(Fe){return re?!!re[dn(Fe,o.value)]:_.value.includes(Fe)};let Pe=!0,ot=0,we=0;for(let Fe=0,at=(r.value||[]).length;Fe{var ie;if(!t||!t.store)return 0;const{treeData:Y}=t.store.states;let re=0;const Ce=(ie=Y.value[ke])==null?void 0:ie.children;return Ce&&(re+=Ce.length,Ce.forEach(Pe=>{re+=Z(Pe)})),re},te=(ke,ie)=>{Array.isArray(ke)||(ke=[ke]);const Y={};return ke.forEach(re=>{O.value[re.id]=ie,Y[re.columnKey||re.id]=ie}),Y},X=(ke,ie,Y)=>{A.value&&A.value!==ke&&(A.value.order=null),A.value=ke,V.value=ie,B.value=Y},le=()=>{let ke=i(l);Object.keys(O.value).forEach(ie=>{const Y=O.value[ie];if(!Y||Y.length===0)return;const re=g_({columns:c.value},ie);re&&re.filterMethod&&(ke=ke.filter(Ce=>Y.some(Pe=>re.filterMethod.call(null,Pe,Ce,re))))}),P.value=ke},de=()=>{r.value=wY(P.value,{sortingColumn:A.value,sortProp:V.value,sortOrder:B.value})},Ie=(ke=void 0)=>{ke&&ke.filter||le(),de()},K=ke=>{const{tableHeaderRef:ie}=t.refs;if(!ie)return;const Y=Object.assign({},ie.filterPanels),re=Object.keys(Y);if(re.length)if(typeof ke=="string"&&(ke=[ke]),Array.isArray(ke)){const Ce=ke.map(Pe=>dY({columns:c.value},Pe));re.forEach(Pe=>{const ot=Ce.find(we=>we.id===Pe);ot&&(ot.filteredValue=[])}),t.store.commit("filterChange",{column:Ce,values:[],silent:!0,multi:!0})}else re.forEach(Ce=>{const Pe=c.value.find(ot=>ot.id===Ce);Pe&&(Pe.filteredValue=[])}),O.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},J=()=>{A.value&&(X(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:fe,toggleRowExpansion:ge,updateExpandRows:Oe,states:ce,isRowExpanded:Te}=gY({data:r,rowKey:o}),{updateTreeExpandKeys:be,toggleTreeExpansion:Ee,updateTreeData:_e,loadOrToggle:Le,states:Re}=bY({data:r,rowKey:o}),{updateCurrentRowData:pe,updateCurrentRow:Ae,setCurrentRowKey:qe,states:rt}=yY({data:r,rowKey:o});return{assertRowKey:H,updateColumns:F,scheduleLayout:T,isSelected:L,clearSelection:R,cleanSelection:U,getSelectionRows:ne,toggleRowSelection:j,_toggleAllSelection:Q,toggleAllSelection:null,updateSelectionByRowKey:he,updateAllSelected:ee,updateFilters:te,updateCurrentRow:Ae,updateSort:X,execFilter:le,execSort:de,execQuery:Ie,clearFilter:K,clearSort:J,toggleRowExpansion:ge,setExpandRowKeysAdapter:ke=>{fe(ke),be(ke)},setCurrentRowKey:qe,toggleRowExpansionAdapter:(ke,ie)=>{c.value.some(({type:re})=>re==="expand")?ge(ke,ie):Ee(ke,ie)},isRowExpanded:Te,updateExpandRows:Oe,updateCurrentRowData:pe,loadOrToggle:Le,updateTreeData:_e,states:{tableSize:n,rowKey:o,data:r,_data:l,isComplex:s,_columns:a,originColumns:u,columns:c,fixedColumns:d,rightFixedColumns:f,leafColumns:p,fixedLeafColumns:v,rightFixedLeafColumns:m,updateOrderFns:h,leafColumnsLength:g,fixedLeafColumnsLength:y,rightFixedLeafColumnsLength:w,isAllSelected:b,selection:_,reserveSelection:k,selectOnIndeterminate:$,selectable:M,filters:O,filteredData:P,sortingColumn:A,sortProp:V,sortOrder:B,hoverRow:D,...ce,...Re,...rt}}}function Af(e,t){return e.map(n=>{var o;return n.id===t.id?t:((o=n.children)!=null&&o.length&&(n.children=Af(n.children,t)),n)})}function xf(e){e.forEach(t=>{var n,o;t.no=(n=t.getColumnIndex)==null?void 0:n.call(t),(o=t.children)!=null&&o.length&&xf(t.children)}),e.sort((t,n)=>t.no-n.no)}function CY(){const e=ut(),t=_Y();return{ns:ye("table"),...t,mutations:{setData(s,a){const u=i(s._data)!==a;s.data.value=a,s._data.value=a,e.store.execQuery(),e.store.updateCurrentRowData(),e.store.updateExpandRows(),e.store.updateTreeData(e.store.states.defaultExpandAll.value),i(s.reserveSelection)?(e.store.assertRowKey(),e.store.updateSelectionByRowKey()):u?e.store.clearSelection():e.store.cleanSelection(),e.store.updateAllSelected(),e.$ready&&e.store.scheduleLayout()},insertColumn(s,a,u,c){const d=i(s._columns);let f=[];u?(u&&!u.children&&(u.children=[]),u.children.push(a),f=Af(d,u)):(d.push(a),f=d),xf(f),s._columns.value=f,s.updateOrderFns.push(c),a.type==="selection"&&(s.selectable.value=a.selectable,s.reserveSelection.value=a.reserveSelection),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},updateColumnOrder(s,a){var u;((u=a.getColumnIndex)==null?void 0:u.call(a))!==a.no&&(xf(s._columns.value),e.$ready&&e.store.updateColumns())},removeColumn(s,a,u,c){const d=i(s._columns)||[];if(u)u.children.splice(u.children.findIndex(p=>p.id===a.id),1),Ke(()=>{var p;((p=u.children)==null?void 0:p.length)===0&&delete u.children}),s._columns.value=Af(d,u);else{const p=d.indexOf(a);p>-1&&(d.splice(p,1),s._columns.value=d)}const f=s.updateOrderFns.indexOf(c);f>-1&&s.updateOrderFns.splice(f,1),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},sort(s,a){const{prop:u,order:c,init:d}=a;if(u){const f=i(s.columns).find(p=>p.property===u);f&&(f.order=c,e.store.updateSort(f,u,c),e.store.commit("changeSortCondition",{init:d}))}},changeSortCondition(s,a){const{sortingColumn:u,sortProp:c,sortOrder:d}=s,f=i(u),p=i(c),v=i(d);v===null&&(s.sortingColumn.value=null,s.sortProp.value=null);const m={filter:!0};e.store.execQuery(m),(!a||!(a.silent||a.init))&&e.emit("sort-change",{column:f,prop:p,order:v}),e.store.updateTableScrollY()},filterChange(s,a){const{column:u,values:c,silent:d}=a,f=e.store.updateFilters(u,c);e.store.execQuery(),d||e.emit("filter-change",f),e.store.updateTableScrollY()},toggleAllSelection(){e.store.toggleAllSelection()},rowSelectedChanged(s,a){e.store.toggleRowSelection(a),e.store.updateAllSelected()},setHoverRow(s,a){s.hoverRow.value=a},setCurrentRow(s,a){e.store.updateCurrentRow(a)}},commit:function(s,...a){const u=e.store.mutations;if(u[s])u[s].apply(e,[e.store.states].concat(a));else throw new Error(`Action not found: ${s}`)},updateTableScrollY:function(){Ke(()=>e.layout.updateScrollY.apply(e.layout))}}}const Qs={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function SY(e,t){if(!e)throw new Error("Table is required.");const n=CY();return n.toggleAllSelection=$n(n._toggleAllSelection,10),Object.keys(Qs).forEach(o=>{__(C_(t,o),o,n)}),kY(n,t),n}function kY(e,t){Object.keys(Qs).forEach(n=>{me(()=>C_(t,n),o=>{__(o,n,e)})})}function __(e,t,n){let o=e,r=Qs[t];typeof Qs[t]=="object"&&(r=r.key,o=o||Qs[t].default),n.states[r].value=o}function C_(e,t){if(t.includes(".")){const n=t.split(".");let o=e;return n.forEach(r=>{o=o[r]}),o}else return e[t]}class $Y{constructor(t){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=N(null),this.scrollX=N(!1),this.scrollY=N(!1),this.bodyWidth=N(null),this.fixedWidth=N(null),this.rightFixedWidth=N(null),this.gutterWidth=0;for(const n in t)gt(t,n)&&(It(this[n])?this[n].value=t[n]:this[n]=t[n]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){if(this.height.value===null)return!1;const n=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(n!=null&&n.wrapRef)){let o=!0;const r=this.scrollY.value;return o=n.wrapRef.scrollHeight>n.wrapRef.clientHeight,this.scrollY.value=o,r!==o}return!1}setHeight(t,n="height"){if(!bt)return;const o=this.table.vnode.el;if(t=pY(t),this.height.value=Number(t),!o&&(t||t===0))return Ke(()=>this.setHeight(t,n));typeof t=="number"?(o.style[n]=`${t}px`,this.updateElsHeight()):typeof t=="string"&&(o.style[n]=t,this.updateElsHeight())}setMaxHeight(t){this.setHeight(t,"max-height")}getFlattenColumns(){const t=[];return this.table.store.states.columns.value.forEach(o=>{o.isColumnGroup?t.push.apply(t,o.columns):t.push(o)}),t}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(t){if(!t)return!0;let n=t;for(;n.tagName!=="DIV";){if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}updateColumnsWidth(){if(!bt)return;const t=this.fit,n=this.table.vnode.el.clientWidth;let o=0;const r=this.getFlattenColumns(),l=r.filter(u=>typeof u.width!="number");if(r.forEach(u=>{typeof u.width=="number"&&u.realWidth&&(u.realWidth=null)}),l.length>0&&t){if(r.forEach(u=>{o+=Number(u.width||u.minWidth||80)}),o<=n){this.scrollX.value=!1;const u=n-o;if(l.length===1)l[0].realWidth=Number(l[0].minWidth||80)+u;else{const c=l.reduce((p,v)=>p+Number(v.minWidth||80),0),d=u/c;let f=0;l.forEach((p,v)=>{if(v===0)return;const m=Math.floor(Number(p.minWidth||80)*d);f+=m,p.realWidth=Number(p.minWidth||80)+m}),l[0].realWidth=Number(l[0].minWidth||80)+u-f}}else this.scrollX.value=!0,l.forEach(u=>{u.realWidth=Number(u.minWidth)});this.bodyWidth.value=Math.max(o,n),this.table.state.resizeState.value.width=this.bodyWidth.value}else r.forEach(u=>{!u.width&&!u.minWidth?u.realWidth=80:u.realWidth=Number(u.width||u.minWidth),o+=u.realWidth}),this.scrollX.value=o>n,this.bodyWidth.value=o;const s=this.store.states.fixedColumns.value;if(s.length>0){let u=0;s.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.fixedWidth.value=u}const a=this.store.states.rightFixedColumns.value;if(a.length>0){let u=0;a.forEach(c=>{u+=Number(c.realWidth||c.width)}),this.rightFixedWidth.value=u}this.notifyObservers("columns")}addObserver(t){this.observers.push(t)}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&this.observers.splice(n,1)}notifyObservers(t){this.observers.forEach(o=>{var r,l;switch(t){case"columns":(r=o.state)==null||r.onColumnsChange(this);break;case"scrollable":(l=o.state)==null||l.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${t}.`)}})}}const{CheckboxGroup:EY}=oo,TY=G({name:"ElTableFilterPanel",components:{ElCheckbox:oo,ElCheckboxGroup:EY,ElScrollbar:or,ElTooltip:En,ElIcon:ze,ArrowDown:xr,ArrowUp:Xa},directives:{ClickOutside:Mr},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=ut(),{t:n}=Ct(),o=ye("table-filter"),r=t==null?void 0:t.parent;r.filterPanels.value[e.column.id]||(r.filterPanels.value[e.column.id]=t);const l=N(!1),s=N(null),a=C(()=>e.column&&e.column.filters),u=C({get:()=>{var _;return(((_=e.column)==null?void 0:_.filteredValue)||[])[0]},set:_=>{c.value&&(typeof _<"u"&&_!==null?c.value.splice(0,1,_):c.value.splice(0,1))}}),c=C({get(){return e.column?e.column.filteredValue||[]:[]},set(_){e.column&&e.upDataColumn("filteredValue",_)}}),d=C(()=>e.column?e.column.filterMultiple:!0),f=_=>_.value===u.value,p=()=>{l.value=!1},v=_=>{_.stopPropagation(),l.value=!l.value},m=()=>{l.value=!1},h=()=>{w(c.value),p()},g=()=>{c.value=[],w(c.value),p()},y=_=>{u.value=_,w(typeof _<"u"&&_!==null?c.value:[]),p()},w=_=>{e.store.commit("filterChange",{column:e.column,values:_}),e.store.updateAllSelected()};me(l,_=>{e.column&&e.upDataColumn("filterOpened",_)},{immediate:!0});const b=C(()=>{var _,k;return(k=(_=s.value)==null?void 0:_.popperRef)==null?void 0:k.contentRef});return{tooltipVisible:l,multiple:d,filteredValue:c,filterValue:u,filters:a,handleConfirm:h,handleReset:g,handleSelect:y,isActive:f,t:n,ns:o,showFilterPanel:v,hideFilterPanel:m,popperPaneRef:b,tooltip:s}}}),OY={key:0},NY=["disabled"],MY=["label","onClick"];function IY(e,t,n,o,r,l){const s=Qe("el-checkbox"),a=Qe("el-checkbox-group"),u=Qe("el-scrollbar"),c=Qe("arrow-up"),d=Qe("arrow-down"),f=Qe("el-icon"),p=Qe("el-tooltip"),v=ca("click-outside");return S(),ae(p,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.ns.b(),persistent:""},{content:q(()=>[e.multiple?(S(),x("div",OY,[I("div",{class:E(e.ns.e("content"))},[z(u,{"wrap-class":e.ns.e("wrap")},{default:q(()=>[z(a,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=m=>e.filteredValue=m),class:E(e.ns.e("checkbox-group"))},{default:q(()=>[(S(!0),x(xe,null,lt(e.filters,m=>(S(),ae(s,{key:m.value,label:m.value},{default:q(()=>[nt(ue(m.text),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","class"])]),_:1},8,["wrap-class"])],2),I("div",{class:E(e.ns.e("bottom"))},[I("button",{class:E({[e.ns.is("disabled")]:e.filteredValue.length===0}),disabled:e.filteredValue.length===0,type:"button",onClick:t[1]||(t[1]=(...m)=>e.handleConfirm&&e.handleConfirm(...m))},ue(e.t("el.table.confirmFilter")),11,NY),I("button",{type:"button",onClick:t[2]||(t[2]=(...m)=>e.handleReset&&e.handleReset(...m))},ue(e.t("el.table.resetFilter")),1)],2)])):(S(),x("ul",{key:1,class:E(e.ns.e("list"))},[I("li",{class:E([e.ns.e("list-item"),{[e.ns.is("active")]:e.filterValue===void 0||e.filterValue===null}]),onClick:t[3]||(t[3]=m=>e.handleSelect(null))},ue(e.t("el.table.clearFilter")),3),(S(!0),x(xe,null,lt(e.filters,m=>(S(),x("li",{key:m.value,class:E([e.ns.e("list-item"),e.ns.is("active",e.isActive(m))]),label:m.value,onClick:h=>e.handleSelect(m.value)},ue(m.text),11,MY))),128))],2))]),default:q(()=>[et((S(),x("span",{class:E([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...m)=>e.showFilterPanel&&e.showFilterPanel(...m))},[z(f,null,{default:q(()=>[e.column.filterOpened?(S(),ae(c,{key:0})):(S(),ae(d,{key:1}))]),_:1})],2)),[[v,e.hideFilterPanel,e.popperPaneRef]])]),_:1},8,["visible","placement","popper-class"])}var PY=Ne(TY,[["render",IY],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);function S_(e){const t=ut();za(()=>{n.value.addObserver(t)}),tt(()=>{o(n.value),r(n.value)}),er(()=>{o(n.value),r(n.value)}),Ar(()=>{n.value.removeObserver(t)});const n=C(()=>{const l=e.layout;if(!l)throw new Error("Can not find table layout.");return l}),o=l=>{var s;const a=((s=e.vnode.el)==null?void 0:s.querySelectorAll("colgroup > col"))||[];if(!a.length)return;const u=l.getFlattenColumns(),c={};u.forEach(d=>{c[d.id]=d});for(let d=0,f=a.length;d{var s,a;const u=((s=e.vnode.el)==null?void 0:s.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let d=0,f=u.length;d{h.stopPropagation()},l=(h,g)=>{!g.filters&&g.sortable?m(h,g,!1):g.filterable&&!g.sortable&&r(h),o==null||o.emit("header-click",g,h)},s=(h,g)=>{o==null||o.emit("header-contextmenu",g,h)},a=N(null),u=N(!1),c=N({}),d=(h,g)=>{if(bt&&!(g.children&&g.children.length>0)&&a.value&&e.border){u.value=!0;const y=o;t("set-drag-visible",!0);const b=(y==null?void 0:y.vnode.el).getBoundingClientRect().left,_=n.vnode.el.querySelector(`th.${g.id}`),k=_.getBoundingClientRect(),$=k.left-b+30;To(_,"noclick"),c.value={startMouseLeft:h.clientX,startLeft:k.right-b,startColumnLeft:k.left-b,tableLeft:b};const M=y==null?void 0:y.refs.resizeProxy;M.style.left=`${c.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const O=A=>{const V=A.clientX-c.value.startMouseLeft,B=c.value.startLeft+V;M.style.left=`${Math.max($,B)}px`},P=()=>{if(u.value){const{startColumnLeft:A,startLeft:V}=c.value,D=Number.parseInt(M.style.left,10)-A;g.width=g.realWidth=D,y==null||y.emit("header-dragend",g.width,V-A,g,h),requestAnimationFrame(()=>{e.store.scheduleLayout(!1,!0)}),document.body.style.cursor="",u.value=!1,a.value=null,c.value={},t("set-drag-visible",!1)}document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",P),document.onselectstart=null,document.ondragstart=null,setTimeout(()=>{In(_,"noclick")},0)};document.addEventListener("mousemove",O),document.addEventListener("mouseup",P)}},f=(h,g)=>{var y;if(g.children&&g.children.length>0)return;const w=(y=h.target)==null?void 0:y.closest("th");if(!(!g||!g.resizable)&&!u.value&&e.border){const b=w.getBoundingClientRect(),_=document.body.style;b.width>12&&b.right-h.pageX<8?(_.cursor="col-resize",po(w,"is-sortable")&&(w.style.cursor="col-resize"),a.value=g):u.value||(_.cursor="",po(w,"is-sortable")&&(w.style.cursor="pointer"),a.value=null)}},p=()=>{bt&&(document.body.style.cursor="")},v=({order:h,sortOrders:g})=>{if(h==="")return g[0];const y=g.indexOf(h||null);return g[y>g.length-2?0:y+1]},m=(h,g,y)=>{var w;h.stopPropagation();const b=g.order===y?null:y||v(g),_=(w=h.target)==null?void 0:w.closest("th");if(_&&po(_,"noclick")){In(_,"noclick");return}if(!g.sortable)return;const k=e.store.states;let $=k.sortProp.value,M;const O=k.sortingColumn.value;(O!==g||O===g&&O.order===null)&&(O&&(O.order=null),k.sortingColumn.value=g,$=g.property),b?M=g.order=b:M=g.order=null,k.sortProp.value=$,k.sortOrder.value=M,o==null||o.store.commit("changeSortCondition")};return{handleHeaderClick:l,handleHeaderContextMenu:s,handleMouseDown:d,handleMouseMove:f,handleMouseOut:p,handleSortClick:m,handleFilterClick:r}}function AY(e){const t=De(Do),n=ye("table");return{getHeaderRowStyle:a=>{const u=t==null?void 0:t.props.headerRowStyle;return typeof u=="function"?u.call(null,{rowIndex:a}):u},getHeaderRowClass:a=>{const u=[],c=t==null?void 0:t.props.headerRowClassName;return typeof c=="string"?u.push(c):typeof c=="function"&&u.push(c.call(null,{rowIndex:a})),u.join(" ")},getHeaderCellStyle:(a,u,c,d)=>{var f;let p=(f=t==null?void 0:t.props.headerCellStyle)!=null?f:{};typeof p=="function"&&(p=p.call(null,{rowIndex:a,columnIndex:u,row:c,column:d}));const v=Ah(u,d.fixed,e.store,c);return ds(v,"left"),ds(v,"right"),Object.assign({},p,v)},getHeaderCellClass:(a,u,c,d)=>{const f=Rh(n.b(),u,d.fixed,e.store,c),p=[d.id,d.order,d.headerAlign,d.className,d.labelClassName,...f];d.children||p.push("is-leaf"),d.sortable&&p.push("is-sortable");const v=t==null?void 0:t.props.headerCellClassName;return typeof v=="string"?p.push(v):typeof v=="function"&&p.push(v.call(null,{rowIndex:a,columnIndex:u,row:c,column:d})),p.push(n.e("cell")),p.filter(m=>!!m).join(" ")}}}const k_=e=>{const t=[];return e.forEach(n=>{n.children?(t.push(n),t.push.apply(t,k_(n.children))):t.push(n)}),t},xY=e=>{let t=1;const n=(l,s)=>{if(s&&(l.level=s.level+1,t{n(u,l),a+=u.colSpan}),l.colSpan=a}else l.colSpan=1};e.forEach(l=>{l.level=1,n(l,void 0)});const o=[];for(let l=0;l{l.children?(l.rowSpan=1,l.children.forEach(s=>s.isSubColumn=!0)):l.rowSpan=t-l.level+1,o[l.level-1].push(l)}),o};function LY(e){const t=De(Do),n=C(()=>xY(e.store.states.originColumns.value));return{isGroup:C(()=>{const l=n.value.length>1;return l&&t&&(t.state.isGroup.value=!0),l}),toggleAllSelection:l=>{l.stopPropagation(),t==null||t.store.commit("toggleAllSelection")},columnRows:n}}var DY=G({name:"ElTableHeader",components:{ElCheckbox:oo},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const n=ut(),o=De(Do),r=ye("table"),l=N({}),{onColumnsChange:s,onScrollableChange:a}=S_(o);tt(async()=>{await Ke(),await Ke();const{prop:$,order:M}=e.defaultSort;o==null||o.store.commit("sort",{prop:$,order:M,init:!0})});const{handleHeaderClick:u,handleHeaderContextMenu:c,handleMouseDown:d,handleMouseMove:f,handleMouseOut:p,handleSortClick:v,handleFilterClick:m}=RY(e,t),{getHeaderRowStyle:h,getHeaderRowClass:g,getHeaderCellStyle:y,getHeaderCellClass:w}=AY(e),{isGroup:b,toggleAllSelection:_,columnRows:k}=LY(e);return n.state={onColumnsChange:s,onScrollableChange:a},n.filterPanels=l,{ns:r,filterPanels:l,onColumnsChange:s,onScrollableChange:a,columnRows:k,getHeaderRowClass:g,getHeaderRowStyle:h,getHeaderCellClass:w,getHeaderCellStyle:y,handleHeaderClick:u,handleHeaderContextMenu:c,handleMouseDown:d,handleMouseMove:f,handleMouseOut:p,handleSortClick:v,handleFilterClick:m,isGroup:b,toggleAllSelection:_}},render(){const{ns:e,isGroup:t,columnRows:n,getHeaderCellStyle:o,getHeaderCellClass:r,getHeaderRowClass:l,getHeaderRowStyle:s,handleHeaderClick:a,handleHeaderContextMenu:u,handleMouseDown:c,handleMouseMove:d,handleSortClick:f,handleMouseOut:p,store:v,$parent:m}=this;let h=1;return je("thead",{class:{[e.is("group")]:t}},n.map((g,y)=>je("tr",{class:l(y),key:y,style:s(y)},g.map((w,b)=>(w.rowSpan>h&&(h=w.rowSpan),je("th",{class:r(y,b,g,w),colspan:w.colSpan,key:`${w.id}-thead`,rowspan:w.rowSpan,style:o(y,b,g,w),onClick:_=>a(_,w),onContextmenu:_=>u(_,w),onMousedown:_=>c(_,w),onMousemove:_=>d(_,w),onMouseout:p},[je("div",{class:["cell",w.filteredValue&&w.filteredValue.length>0?"highlight":""]},[w.renderHeader?w.renderHeader({column:w,$index:b,store:v,_self:m}):w.label,w.sortable&&je("span",{onClick:_=>f(_,w),class:"caret-wrapper"},[je("i",{onClick:_=>f(_,w,"ascending"),class:"sort-caret ascending"}),je("i",{onClick:_=>f(_,w,"descending"),class:"sort-caret descending"})]),w.filterable&&je(PY,{store:v,placement:w.filterPlacement||"bottom-start",column:w,upDataColumn:(_,k)=>{w[_]=k}})])]))))))}});function BY(e){const t=De(Do),n=N(""),o=N(je("div")),{nextZIndex:r}=Sl(),l=(v,m,h)=>{var g;const y=t,w=sd(v);let b;const _=(g=y==null?void 0:y.vnode.el)==null?void 0:g.dataset.prefix;w&&(b=cy({columns:e.store.states.columns.value},w,_),b&&(y==null||y.emit(`cell-${h}`,m,b,w,v))),y==null||y.emit(`row-${h}`,m,b,v)},s=(v,m)=>{l(v,m,"dblclick")},a=(v,m)=>{e.store.commit("setCurrentRow",m),l(v,m,"click")},u=(v,m)=>{l(v,m,"contextmenu")},c=$n(v=>{e.store.commit("setHoverRow",v)},30),d=$n(()=>{e.store.commit("setHoverRow",null)},30);return{handleDoubleClick:s,handleClick:a,handleContextMenu:u,handleMouseEnter:c,handleMouseLeave:d,handleCellMouseEnter:(v,m,h)=>{var g;const y=t,w=sd(v),b=(g=y==null?void 0:y.vnode.el)==null?void 0:g.dataset.prefix;if(w){const O=cy({columns:e.store.states.columns.value},w,b),P=y.hoverState={cell:w,column:O,row:m};y==null||y.emit("cell-mouse-enter",P.row,P.column,P.cell,v)}if(!h)return;const _=v.target.querySelector(".cell");if(!(po(_,`${b}-tooltip`)&&_.childNodes.length))return;const k=document.createRange();k.setStart(_,0),k.setEnd(_,_.childNodes.length);const $=Math.round(k.getBoundingClientRect().width),M=(Number.parseInt(jo(_,"paddingLeft"),10)||0)+(Number.parseInt(jo(_,"paddingRight"),10)||0);($+M>_.offsetWidth||_.scrollWidth>_.offsetWidth)&&mY(t==null?void 0:t.refs.tableWrapper,w,w.innerText||w.textContent,r,h)},handleCellMouseLeave:v=>{if(!sd(v))return;const h=t==null?void 0:t.hoverState;t==null||t.emit("cell-mouse-leave",h==null?void 0:h.row,h==null?void 0:h.column,h==null?void 0:h.cell,v)},tooltipContent:n,tooltipTrigger:o}}function FY(e){const t=De(Do),n=ye("table");return{getRowStyle:(c,d)=>{const f=t==null?void 0:t.props.rowStyle;return typeof f=="function"?f.call(null,{row:c,rowIndex:d}):f||null},getRowClass:(c,d)=>{const f=[n.e("row")];t!=null&&t.props.highlightCurrentRow&&c===e.store.states.currentRow.value&&f.push("current-row"),e.stripe&&d%2===1&&f.push(n.em("row","striped"));const p=t==null?void 0:t.props.rowClassName;return typeof p=="string"?f.push(p):typeof p=="function"&&f.push(p.call(null,{row:c,rowIndex:d})),f},getCellStyle:(c,d,f,p)=>{const v=t==null?void 0:t.props.cellStyle;let m=v??{};typeof v=="function"&&(m=v.call(null,{rowIndex:c,columnIndex:d,row:f,column:p}));const h=Ah(d,e==null?void 0:e.fixed,e.store);return ds(h,"left"),ds(h,"right"),Object.assign({},m,h)},getCellClass:(c,d,f,p,v)=>{const m=Rh(n.b(),d,e==null?void 0:e.fixed,e.store,void 0,v),h=[p.id,p.align,p.className,...m],g=t==null?void 0:t.props.cellClassName;return typeof g=="string"?h.push(g):typeof g=="function"&&h.push(g.call(null,{rowIndex:c,columnIndex:d,row:f,column:p})),h.push(n.e("cell")),h.filter(y=>!!y).join(" ")},getSpan:(c,d,f,p)=>{let v=1,m=1;const h=t==null?void 0:t.props.spanMethod;if(typeof h=="function"){const g=h({row:c,column:d,rowIndex:f,columnIndex:p});Array.isArray(g)?(v=g[0],m=g[1]):typeof g=="object"&&(v=g.rowspan,m=g.colspan)}return{rowspan:v,colspan:m}},getColspanRealWidth:(c,d,f)=>{if(d<1)return c[f].realWidth;const p=c.map(({realWidth:v,width:m})=>v||m).slice(f,f+d);return Number(p.reduce((v,m)=>Number(v)+Number(m),-1))}}}function VY(e){const t=De(Do),n=ye("table"),{handleDoubleClick:o,handleClick:r,handleContextMenu:l,handleMouseEnter:s,handleMouseLeave:a,handleCellMouseEnter:u,handleCellMouseLeave:c,tooltipContent:d,tooltipTrigger:f}=BY(e),{getRowStyle:p,getRowClass:v,getCellStyle:m,getCellClass:h,getSpan:g,getColspanRealWidth:y}=FY(e),w=C(()=>e.store.states.columns.value.findIndex(({type:M})=>M==="default")),b=(M,O)=>{const P=t.props.rowKey;return P?dn(M,P):O},_=(M,O,P,A=!1)=>{const{tooltipEffect:V,tooltipOptions:B,store:D}=e,{indent:H,columns:W}=D.states,F=v(M,O);let T=!0;return P&&(F.push(n.em("row",`level-${P.level}`)),T=P.display),je("tr",{style:[T?null:{display:"none"},p(M,O)],class:F,key:b(M,O),onDblclick:R=>o(R,M),onClick:R=>r(R,M),onContextmenu:R=>l(R,M),onMouseenter:()=>s(O),onMouseleave:a},W.value.map((R,U)=>{const{rowspan:ne,colspan:j}=g(M,R,O,U);if(!ne||!j)return null;const Q={...R};Q.realWidth=y(W.value,j,U);const he={store:e.store,_self:e.context||t,column:Q,row:M,$index:O,cellIndex:U,expanded:A};U===w.value&&P&&(he.treeNode={indent:P.level*H.value,level:P.level},typeof P.expanded=="boolean"&&(he.treeNode.expanded=P.expanded,"loading"in P&&(he.treeNode.loading=P.loading),"noLazyChildren"in P&&(he.treeNode.noLazyChildren=P.noLazyChildren)));const ee=`${O},${U}`,Z=Q.columnKey||Q.rawColumnKey||"",te=k(U,R,he),X=R.showOverflowTooltip&&Qb({effect:V},B,R.showOverflowTooltip);return je("td",{style:m(O,U,M,R),class:h(O,U,M,R,j-1),key:`${Z}${ee}`,rowspan:ne,colspan:j,onMouseenter:le=>u(le,M,X),onMouseleave:c},[te])}))},k=(M,O,P)=>O.renderCell(P);return{wrappedRowRender:(M,O)=>{const P=e.store,{isRowExpanded:A,assertRowKey:V}=P,{treeData:B,lazyTreeNodeMap:D,childrenColumnName:H,rowKey:W}=P.states,F=P.states.columns.value;if(F.some(({type:L})=>L==="expand")){const L=A(M),R=_(M,O,void 0,L),U=t.renderExpanded;return L?U?[[R,je("tr",{key:`expanded-row__${R.key}`},[je("td",{colspan:F.length,class:`${n.e("cell")} ${n.e("expanded-cell")}`},[U({row:M,$index:O,store:P,expanded:L})])])]]:(console.error("[Element Error]renderExpanded is required."),R):[[R]]}else if(Object.keys(B.value).length){V();const L=dn(M,W.value);let R=B.value[L],U=null;R&&(U={expanded:R.expanded,level:R.level,display:!0},typeof R.lazy=="boolean"&&(typeof R.loaded=="boolean"&&R.loaded&&(U.noLazyChildren=!(R.children&&R.children.length)),U.loading=R.loading));const ne=[_(M,O,U)];if(R){let j=0;const Q=(ee,Z)=>{ee&&ee.length&&Z&&ee.forEach(te=>{const X={display:Z.display&&Z.expanded,level:Z.level+1,expanded:!1,noLazyChildren:!1,loading:!1},le=dn(te,W.value);if(le==null)throw new Error("For nested data item, row-key is required.");if(R={...B.value[le]},R&&(X.expanded=R.expanded,R.level=R.level||X.level,R.display=!!(R.expanded&&X.display),typeof R.lazy=="boolean"&&(typeof R.loaded=="boolean"&&R.loaded&&(X.noLazyChildren=!(R.children&&R.children.length)),X.loading=R.loading)),j++,ne.push(_(te,O+j,X)),R){const de=D.value[le]||te[H.value];Q(de,R)}})};R.display=!0;const he=D.value[L]||M[H.value];Q(he,R)}return ne}else return _(M,O,void 0)},tooltipContent:d,tooltipTrigger:f}}const zY={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean};var HY=G({name:"ElTableBody",props:zY,setup(e){const t=ut(),n=De(Do),o=ye("table"),{wrappedRowRender:r,tooltipContent:l,tooltipTrigger:s}=VY(e),{onColumnsChange:a,onScrollableChange:u}=S_(n);return me(e.store.states.hoverRow,(c,d)=>{if(!e.store.states.isComplex.value||!bt)return;let f=window.requestAnimationFrame;f||(f=p=>window.setTimeout(p,16)),f(()=>{const p=t==null?void 0:t.vnode.el,v=Array.from((p==null?void 0:p.children)||[]).filter(g=>g==null?void 0:g.classList.contains(`${o.e("row")}`)),m=v[d],h=v[c];m&&In(m,"hover-row"),h&&To(h,"hover-row")})}),Ar(()=>{var c;(c=zo)==null||c()}),{ns:o,onColumnsChange:a,onScrollableChange:u,wrappedRowRender:r,tooltipContent:l,tooltipTrigger:s}},render(){const{wrappedRowRender:e,store:t}=this,n=t.states.data.value||[];return je("tbody",{},[n.reduce((o,r)=>o.concat(e(r,o.length)),[])])}});function xh(e){const t=e.tableLayout==="auto";let n=e.columns||[];t&&n.every(r=>r.width===void 0)&&(n=[]);const o=r=>{const l={key:`${e.tableLayout}_${r.id}`,style:{},name:void 0};return t?l.style={width:`${r.width}px`}:l.name=r.id,l};return je("colgroup",{},n.map(r=>je("col",o(r))))}xh.props=["columns","tableLayout"];function KY(){const e=De(Do),t=e==null?void 0:e.store,n=C(()=>t.states.fixedLeafColumnsLength.value),o=C(()=>t.states.rightFixedColumns.value.length),r=C(()=>t.states.columns.value.length),l=C(()=>t.states.fixedColumns.value.length),s=C(()=>t.states.rightFixedColumns.value.length);return{leftFixedLeafCount:n,rightFixedLeafCount:o,columnsCount:r,leftFixedCount:l,rightFixedCount:s,columns:t.states.columns}}function jY(e){const{columns:t}=KY(),n=ye("table");return{getCellClasses:(l,s)=>{const a=l[s],u=[n.e("cell"),a.id,a.align,a.labelClassName,...Rh(n.b(),s,a.fixed,e.store)];return a.className&&u.push(a.className),a.children||u.push(n.is("leaf")),u},getCellStyles:(l,s)=>{const a=Ah(s,l.fixed,e.store);return ds(a,"left"),ds(a,"right"),a},columns:t}}var WY=G({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:n,columns:o}=jY(e);return{ns:ye("table"),getCellClasses:t,getCellStyles:n,columns:o}},render(){const{columns:e,getCellStyles:t,getCellClasses:n,summaryMethod:o,sumText:r,ns:l}=this,s=this.store.states.data.value;let a=[];return o?a=o({columns:e,data:s}):e.forEach((u,c)=>{if(c===0){a[c]=r;return}const d=s.map(m=>Number(m[u.property])),f=[];let p=!0;d.forEach(m=>{if(!Number.isNaN(+m)){p=!1;const h=`${m}`.split(".")[1];f.push(h?h.length:0)}});const v=Math.max.apply(null,f);p?a[c]="":a[c]=d.reduce((m,h)=>{const g=Number(h);return Number.isNaN(+g)?m:Number.parseFloat((m+h).toFixed(Math.min(v,20)))},0)}),je("table",{class:l.e("footer"),cellspacing:"0",cellpadding:"0",border:"0"},[xh({columns:e}),je("tbody",[je("tr",{},[...e.map((u,c)=>je("td",{key:c,colspan:u.colSpan,rowspan:u.rowSpan,class:n(e,c),style:t(u,c)},[je("div",{class:["cell",u.labelClassName]},[a[c]])]))])])])}});function UY(e){return{setCurrentRow:d=>{e.commit("setCurrentRow",d)},getSelectionRows:()=>e.getSelectionRows(),toggleRowSelection:(d,f)=>{e.toggleRowSelection(d,f,!1),e.updateAllSelected()},clearSelection:()=>{e.clearSelection()},clearFilter:d=>{e.clearFilter(d)},toggleAllSelection:()=>{e.commit("toggleAllSelection")},toggleRowExpansion:(d,f)=>{e.toggleRowExpansionAdapter(d,f)},clearSort:()=>{e.clearSort()},sort:(d,f)=>{e.commit("sort",{prop:d,order:f})}}}function qY(e,t,n,o){const r=N(!1),l=N(null),s=N(!1),a=L=>{s.value=L},u=N({width:null,height:null,headerHeight:null}),c=N(!1),d={display:"inline-block",verticalAlign:"middle"},f=N(),p=N(0),v=N(0),m=N(0),h=N(0);Kn(()=>{t.setHeight(e.height)}),Kn(()=>{t.setMaxHeight(e.maxHeight)}),me(()=>[e.currentRowKey,n.states.rowKey],([L,R])=>{!i(R)||!i(L)||n.setCurrentRowKey(`${L}`)},{immediate:!0}),me(()=>e.data,L=>{o.store.commit("setData",L)},{immediate:!0,deep:!0}),Kn(()=>{e.expandRowKeys&&n.setExpandRowKeysAdapter(e.expandRowKeys)});const g=()=>{o.store.commit("setHoverRow",null),o.hoverState&&(o.hoverState=null)},y=(L,R)=>{const{pixelX:U,pixelY:ne}=R;Math.abs(U)>=Math.abs(ne)&&(o.refs.bodyWrapper.scrollLeft+=R.pixelX/5)},w=C(()=>e.height||e.maxHeight||n.states.fixedColumns.value.length>0||n.states.rightFixedColumns.value.length>0),b=C(()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""})),_=()=>{w.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(O)};tt(async()=>{await Ke(),n.updateColumns(),P(),requestAnimationFrame(_);const L=o.vnode.el,R=o.refs.headerWrapper;e.flexible&&L&&L.parentElement&&(L.parentElement.style.minWidth="0"),u.value={width:f.value=L.offsetWidth,height:L.offsetHeight,headerHeight:e.showHeader&&R?R.offsetHeight:null},n.states.columns.value.forEach(U=>{U.filteredValue&&U.filteredValue.length&&o.store.commit("filterChange",{column:U,values:U.filteredValue,silent:!0})}),o.$ready=!0});const k=(L,R)=>{if(!L)return;const U=Array.from(L.classList).filter(ne=>!ne.startsWith("is-scrolling-"));U.push(t.scrollX.value?R:"is-scrolling-none"),L.className=U.join(" ")},$=L=>{const{tableWrapper:R}=o.refs;k(R,L)},M=L=>{const{tableWrapper:R}=o.refs;return!!(R&&R.classList.contains(L))},O=function(){if(!o.refs.scrollBarRef)return;if(!t.scrollX.value){const ee="is-scrolling-none";M(ee)||$(ee);return}const L=o.refs.scrollBarRef.wrapRef;if(!L)return;const{scrollLeft:R,offsetWidth:U,scrollWidth:ne}=L,{headerWrapper:j,footerWrapper:Q}=o.refs;j&&(j.scrollLeft=R),Q&&(Q.scrollLeft=R);const he=ne-U-1;R>=he?$("is-scrolling-right"):$(R===0?"is-scrolling-left":"is-scrolling-middle")},P=()=>{o.refs.scrollBarRef&&(o.refs.scrollBarRef.wrapRef&&Vt(o.refs.scrollBarRef.wrapRef,"scroll",O,{passive:!0}),e.fit?gn(o.vnode.el,A):Vt(window,"resize",A),gn(o.refs.bodyWrapper,()=>{var L,R;A(),(R=(L=o.refs)==null?void 0:L.scrollBarRef)==null||R.update()}))},A=()=>{var L,R,U;const ne=o.vnode.el;if(!o.$ready||!ne)return;let j=!1;const{width:Q,height:he,headerHeight:ee}=u.value,Z=f.value=ne.offsetWidth;Q!==Z&&(j=!0);const te=ne.offsetHeight;(e.height||w.value)&&he!==te&&(j=!0);const X=e.tableLayout==="fixed"?o.refs.headerWrapper:(L=o.refs.tableHeaderRef)==null?void 0:L.$el;e.showHeader&&(X==null?void 0:X.offsetHeight)!==ee&&(j=!0),p.value=((R=o.refs.tableWrapper)==null?void 0:R.scrollHeight)||0,m.value=(X==null?void 0:X.scrollHeight)||0,h.value=((U=o.refs.footerWrapper)==null?void 0:U.offsetHeight)||0,v.value=p.value-m.value-h.value,j&&(u.value={width:Z,height:te,headerHeight:e.showHeader&&(X==null?void 0:X.offsetHeight)||0},_())},V=Jt(),B=C(()=>{const{bodyWidth:L,scrollY:R,gutterWidth:U}=t;return L.value?`${L.value-(R.value?U:0)}px`:""}),D=C(()=>e.maxHeight?"fixed":e.tableLayout),H=C(()=>{if(e.data&&e.data.length)return null;let L="100%";e.height&&v.value&&(L=`${v.value}px`);const R=f.value;return{width:R?`${R}px`:"",height:L}}),W=C(()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{}),F=C(()=>{if(e.height)return{height:"100%"};if(e.maxHeight){if(Number.isNaN(Number(e.maxHeight)))return{maxHeight:`calc(${e.maxHeight} - ${m.value+h.value}px)`};{const L=e.maxHeight;if(p.value>=Number(L))return{maxHeight:`${p.value-m.value-h.value}px`}}}return{}});return{isHidden:r,renderExpanded:l,setDragVisible:a,isGroup:c,handleMouseLeave:g,handleHeaderFooterMousewheel:y,tableSize:V,emptyBlockStyle:H,handleFixedMousewheel:(L,R)=>{const U=o.refs.bodyWrapper;if(Math.abs(R.spinY)>0){const ne=U.scrollTop;R.pixelY<0&&ne!==0&&L.preventDefault(),R.pixelY>0&&U.scrollHeight-U.clientHeight>ne&&L.preventDefault(),U.scrollTop+=Math.ceil(R.pixelY/5)}else U.scrollLeft+=Math.ceil(R.pixelX/5)},resizeProxyVisible:s,bodyWidth:B,resizeState:u,doLayout:_,tableBodyStyles:b,tableLayout:D,scrollbarViewStyle:d,tableInnerStyle:W,scrollbarStyle:F}}function YY(e){const t=N(),n=()=>{const r=e.vnode.el.querySelector(".hidden-columns"),l={childList:!0,subtree:!0},s=e.store.states.updateOrderFns;t.value=new MutationObserver(()=>{s.forEach(a=>a())}),t.value.observe(r,l)};tt(()=>{n()}),Ar(()=>{var o;(o=t.value)==null||o.disconnect()})}var GY={data:{type:Array,default:()=>[]},size:hn,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean};const XY=()=>{const e=N(),t=(l,s)=>{const a=e.value;a&&a.scrollTo(l,s)},n=(l,s)=>{const a=e.value;a&&Xe(s)&&["Top","Left"].includes(l)&&a[`setScroll${l}`](s)};return{scrollBarRef:e,scrollTo:t,setScrollTop:l=>n("Top",l),setScrollLeft:l=>n("Left",l)}};let JY=1;const ZY=G({name:"ElTable",directives:{Mousewheel:QB},components:{TableHeader:DY,TableBody:HY,TableFooter:WY,ElScrollbar:or,hColgroup:xh},props:GY,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t}=Ct(),n=ye("table"),o=ut();ht(Do,o);const r=SY(o,e);o.store=r;const l=new $Y({store:o.store,table:o,fit:e.fit,showHeader:e.showHeader});o.layout=l;const s=C(()=>(r.states.data.value||[]).length===0),{setCurrentRow:a,getSelectionRows:u,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:v,clearSort:m,sort:h}=UY(r),{isHidden:g,renderExpanded:y,setDragVisible:w,isGroup:b,handleMouseLeave:_,handleHeaderFooterMousewheel:k,tableSize:$,emptyBlockStyle:M,handleFixedMousewheel:O,resizeProxyVisible:P,bodyWidth:A,resizeState:V,doLayout:B,tableBodyStyles:D,tableLayout:H,scrollbarViewStyle:W,tableInnerStyle:F,scrollbarStyle:T}=qY(e,l,r,o),{scrollBarRef:L,scrollTo:R,setScrollLeft:U,setScrollTop:ne}=XY(),j=$n(B,50),Q=`${n.namespace.value}-table_${JY++}`;o.tableId=Q,o.state={isGroup:b,resizeState:V,doLayout:B,debouncedUpdateLayout:j};const he=C(()=>e.sumText||t("el.table.sumText")),ee=C(()=>e.emptyText||t("el.table.emptyText"));return YY(o),{ns:n,layout:l,store:r,handleHeaderFooterMousewheel:k,handleMouseLeave:_,tableId:Q,tableSize:$,isHidden:g,isEmpty:s,renderExpanded:y,resizeProxyVisible:P,resizeState:V,isGroup:b,bodyWidth:A,tableBodyStyles:D,emptyBlockStyle:M,debouncedUpdateLayout:j,handleFixedMousewheel:O,setCurrentRow:a,getSelectionRows:u,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:v,clearSort:m,doLayout:B,sort:h,t,setDragVisible:w,context:o,computedSumText:he,computedEmptyText:ee,tableLayout:H,scrollbarViewStyle:W,tableInnerStyle:F,scrollbarStyle:T,scrollBarRef:L,scrollTo:R,setScrollLeft:U,setScrollTop:ne}}}),QY=["data-prefix"],eG={ref:"hiddenColumns",class:"hidden-columns"};function tG(e,t,n,o,r,l){const s=Qe("hColgroup"),a=Qe("table-header"),u=Qe("table-body"),c=Qe("el-scrollbar"),d=Qe("table-footer"),f=ca("mousewheel");return S(),x("div",{ref:"tableWrapper",class:E([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:He(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=p=>e.handleMouseLeave())},[I("div",{class:E(e.ns.e("inner-wrapper")),style:He(e.tableInnerStyle)},[I("div",eG,[ve(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?et((S(),x("div",{key:0,ref:"headerWrapper",class:E(e.ns.e("header-wrapper"))},[I("table",{ref:"tableHeader",class:E(e.ns.e("header")),style:He(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[z(s,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),z(a,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):oe("v-if",!0),I("div",{ref:"bodyWrapper",class:E(e.ns.e("body-wrapper"))},[z(c,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:q(()=>[I("table",{ref:"tableBody",class:E(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:He({width:e.bodyWidth,tableLayout:e.tableLayout})},[z(s,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(S(),ae(a,{key:0,ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])):oe("v-if",!0),z(u,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"])],6),e.isEmpty?(S(),x("div",{key:0,ref:"emptyBlock",style:He(e.emptyBlockStyle),class:E(e.ns.e("empty-block"))},[I("span",{class:E(e.ns.e("empty-text"))},[ve(e.$slots,"empty",{},()=>[nt(ue(e.computedEmptyText),1)])],2)],6)):oe("v-if",!0),e.$slots.append?(S(),x("div",{key:1,ref:"appendWrapper",class:E(e.ns.e("append-wrapper"))},[ve(e.$slots,"append")],2)):oe("v-if",!0)]),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary?et((S(),x("div",{key:1,ref:"footerWrapper",class:E(e.ns.e("footer-wrapper"))},[z(d,{border:e.border,"default-sort":e.defaultSort,store:e.store,style:He(e.tableBodyStyles),"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","style","sum-text","summary-method"])],2)),[[kt,!e.isEmpty],[f,e.handleHeaderFooterMousewheel]]):oe("v-if",!0),e.border||e.isGroup?(S(),x("div",{key:2,class:E(e.ns.e("border-left-patch"))},null,2)):oe("v-if",!0)],6),et(I("div",{ref:"resizeProxy",class:E(e.ns.e("column-resize-proxy"))},null,2),[[kt,e.resizeProxyVisible]])],46,QY)}var nG=Ne(ZY,[["render",tG],["__file","/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);const oG={selection:"table-column--selection",expand:"table__expand-column"},rG={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},lG=e=>oG[e]||"",sG={selection:{renderHeader({store:e}){function t(){return e.states.data.value&&e.states.data.value.length===0}return je(oo,{disabled:t(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value})},renderCell({row:e,column:t,store:n,$index:o}){return je(oo,{disabled:t.selectable?!t.selectable.call(null,e,o):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:r=>r.stopPropagation(),modelValue:n.isSelected(e)})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let n=t+1;const o=e.index;return typeof o=="number"?n=t+o:typeof o=="function"&&(n=o(t)),je("div",{},[n])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:n}){const{ns:o}=t,r=[o.e("expand-icon")];return n&&r.push(o.em("expand-icon","expanded")),je("div",{class:r,onClick:function(s){s.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[je(ze,null,{default:()=>[je(_n)]})]})},sortable:!1,resizable:!1}};function aG({row:e,column:t,$index:n}){var o;const r=t.property,l=r&&Vi(e,r).value;return t&&t.formatter?t.formatter(e,t,l,n):((o=l==null?void 0:l.toString)==null?void 0:o.call(l))||""}function iG({row:e,treeNode:t,store:n},o=!1){const{ns:r}=n;if(!t)return o?[je("span",{class:r.e("placeholder")})]:null;const l=[],s=function(a){a.stopPropagation(),!t.loading&&n.loadOrToggle(e)};if(t.indent&&l.push(je("span",{class:r.e("indent"),style:{"padding-left":`${t.indent}px`}})),typeof t.expanded=="boolean"&&!t.noLazyChildren){const a=[r.e("expand-icon"),t.expanded?r.em("expand-icon","expanded"):""];let u=_n;t.loading&&(u=Dr),l.push(je("div",{class:a,onClick:s},{default:()=>[je(ze,{class:{[r.is("loading")]:t.loading}},{default:()=>[je(u)]})]}))}else l.push(je("span",{class:r.e("placeholder")}));return l}function py(e,t){return e.reduce((n,o)=>(n[o]=o,n),t)}function uG(e,t){const n=ut();return{registerComplexWatchers:()=>{const l=["fixed"],s={realWidth:"width",realMinWidth:"minWidth"},a=py(l,s);Object.keys(a).forEach(u=>{const c=s[u];gt(t,c)&&me(()=>t[c],d=>{let f=d;c==="width"&&u==="realWidth"&&(f=Ph(d)),c==="minWidth"&&u==="realMinWidth"&&(f=y_(d)),n.columnConfig.value[c]=f,n.columnConfig.value[u]=f;const p=c==="fixed";e.value.store.scheduleLayout(p)})})},registerNormalWatchers:()=>{const l=["label","filters","filterMultiple","sortable","index","formatter","className","labelClassName","showOverflowTooltip"],s={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},a=py(l,s);Object.keys(a).forEach(u=>{const c=s[u];gt(t,c)&&me(()=>t[c],d=>{n.columnConfig.value[u]=d})})}}}function cG(e,t,n){const o=ut(),r=N(""),l=N(!1),s=N(),a=N(),u=ye("table");Kn(()=>{s.value=e.align?`is-${e.align}`:null,s.value}),Kn(()=>{a.value=e.headerAlign?`is-${e.headerAlign}`:s.value,a.value});const c=C(()=>{let _=o.vnode.vParent||o.parent;for(;_&&!_.tableId&&!_.columnId;)_=_.vnode.vParent||_.parent;return _}),d=C(()=>{const{store:_}=o.parent;if(!_)return!1;const{treeData:k}=_.states,$=k.value;return $&&Object.keys($).length>0}),f=N(Ph(e.width)),p=N(y_(e.minWidth)),v=_=>(f.value&&(_.width=f.value),p.value&&(_.minWidth=p.value),!f.value&&p.value&&(_.width=void 0),_.minWidth||(_.minWidth=80),_.realWidth=Number(_.width===void 0?_.minWidth:_.width),_),m=_=>{const k=_.type,$=sG[k]||{};Object.keys($).forEach(O=>{const P=$[O];O!=="className"&&P!==void 0&&(_[O]=P)});const M=lG(k);if(M){const O=`${i(u.namespace)}-${M}`;_.className=_.className?`${_.className} ${O}`:O}return _},h=_=>{Array.isArray(_)?_.forEach($=>k($)):k(_);function k($){var M;((M=$==null?void 0:$.type)==null?void 0:M.name)==="ElTableColumn"&&($.vParent=o)}};return{columnId:r,realAlign:s,isSubColumn:l,realHeaderAlign:a,columnOrTableParent:c,setColumnWidth:v,setColumnForcedProps:m,setColumnRenders:_=>{e.renderHeader||_.type!=="selection"&&(_.renderHeader=$=>{o.columnConfig.value.label;const M=t.header;return M?M($):_.label});let k=_.renderCell;return _.type==="expand"?(_.renderCell=$=>je("div",{class:"cell"},[k($)]),n.value.renderExpanded=$=>t.default?t.default($):t.default):(k=k||aG,_.renderCell=$=>{let M=null;if(t.default){const D=t.default($);M=D.some(H=>H.type!==wn)?D:k($)}else M=k($);const{columns:O}=n.value.store.states,P=O.value.findIndex(D=>D.type==="default"),A=d.value&&$.cellIndex===P,V=iG($,A),B={class:"cell",style:{}};return _.showOverflowTooltip&&(B.class=`${B.class} ${i(u.namespace)}-tooltip`,B.style={width:`${($.column.realWidth||Number($.column.width))-1}px`}),h(M),je("div",B,[V,M])}),_},getPropsData:(..._)=>_.reduce((k,$)=>(Array.isArray($)&&$.forEach(M=>{k[M]=e[M]}),k),{}),getColumnElIndex:(_,k)=>Array.prototype.indexOf.call(_,k),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",o.columnConfig.value)}}}var dG={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:[Boolean,Object],fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let fG=1;var $_=G({name:"ElTableColumn",components:{ElCheckbox:oo},props:dG,setup(e,{slots:t}){const n=ut(),o=N({}),r=C(()=>{let b=n.parent;for(;b&&!b.tableId;)b=b.parent;return b}),{registerNormalWatchers:l,registerComplexWatchers:s}=uG(r,e),{columnId:a,isSubColumn:u,realHeaderAlign:c,columnOrTableParent:d,setColumnWidth:f,setColumnForcedProps:p,setColumnRenders:v,getPropsData:m,getColumnElIndex:h,realAlign:g,updateColumnOrder:y}=cG(e,t,r),w=d.value;a.value=`${w.tableId||w.columnId}_column_${fG++}`,za(()=>{u.value=r.value!==w;const b=e.type||"default",_=e.sortable===""?!0:e.sortable,k={...rG[b],id:a.value,type:b,property:e.prop||e.property,align:g,headerAlign:c,showOverflowTooltip:e.showOverflowTooltip,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:_,index:e.index,rawColumnKey:n.vnode.key};let A=m(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement"]);A=fY(k,A),A=hY(v,f,p)(A),o.value=A,l(),s()}),tt(()=>{var b;const _=d.value,k=u.value?_.vnode.el.children:(b=_.refs.hiddenColumns)==null?void 0:b.children,$=()=>h(k||[],n.vnode.el);o.value.getColumnIndex=$,$()>-1&&r.value.store.commit("insertColumn",o.value,u.value?_.columnConfig.value:null,y)}),Dt(()=>{r.value.store.commit("removeColumn",o.value,u.value?w.columnConfig.value:null,y)}),n.columnId=a.value,n.columnConfig=o},render(){var e,t,n;try{const o=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),r=[];if(Array.isArray(o))for(const s of o)((n=s.type)==null?void 0:n.name)==="ElTableColumn"||s.shapeFlag&2?r.push(s):s.type===xe&&Array.isArray(s.children)&&s.children.forEach(a=>{(a==null?void 0:a.patchFlag)!==1024&&!Ze(a==null?void 0:a.children)&&r.push(a)});return je("div",r)}catch{return je("div",[])}}});const pG=it(nG,{TableColumn:$_}),hG=jt($_);var Ra=(e=>(e.ASC="asc",e.DESC="desc",e))(Ra||{}),Aa=(e=>(e.CENTER="center",e.RIGHT="right",e))(Aa||{}),E_=(e=>(e.LEFT="left",e.RIGHT="right",e))(E_||{});const Lf={asc:"desc",desc:"asc"},xa=Symbol("placeholder"),vG=(e,t,n)=>{var o;const r={flexGrow:0,flexShrink:0,...n?{}:{flexGrow:e.flexGrow||0,flexShrink:e.flexShrink||1}};n||(r.flexShrink=1);const l={...(o=e.style)!=null?o:{},...r,flexBasis:"auto",width:e.width};return t||(e.maxWidth&&(l.maxWidth=e.maxWidth),e.minWidth&&(l.minWidth=e.minWidth)),l};function mG(e,t,n){const o=C(()=>i(t).filter(h=>!h.hidden)),r=C(()=>i(o).filter(h=>h.fixed==="left"||h.fixed===!0)),l=C(()=>i(o).filter(h=>h.fixed==="right")),s=C(()=>i(o).filter(h=>!h.fixed)),a=C(()=>{const h=[];return i(r).forEach(g=>{h.push({...g,placeholderSign:xa})}),i(s).forEach(g=>{h.push(g)}),i(l).forEach(g=>{h.push({...g,placeholderSign:xa})}),h}),u=C(()=>i(r).length||i(l).length),c=C(()=>i(t).reduce((g,y)=>(g[y.key]=vG(y,i(n),e.fixed),g),{})),d=C(()=>i(o).reduce((h,g)=>h+g.width,0)),f=h=>i(t).find(g=>g.key===h),p=h=>i(c)[h],v=(h,g)=>{h.width=g};function m(h){var g;const{key:y}=h.currentTarget.dataset;if(!y)return;const{sortState:w,sortBy:b}=e;let _=Ra.ASC;ft(w)?_=Lf[w[y]]:_=Lf[b.order],(g=e.onColumnSort)==null||g.call(e,{column:f(y),key:y,order:_})}return{columns:t,columnsStyles:c,columnsTotalWidth:d,fixedColumnsOnLeft:r,fixedColumnsOnRight:l,hasFixedColumns:u,mainColumns:a,normalColumns:s,visibleColumns:o,getColumn:f,getColumnStyle:p,updateColumnWidth:v,onColumnSorted:m}}const gG=(e,{mainTableRef:t,leftTableRef:n,rightTableRef:o,onMaybeEndReached:r})=>{const l=N({scrollLeft:0,scrollTop:0});function s(v){var m,h,g;const{scrollTop:y}=v;(m=t.value)==null||m.scrollTo(v),(h=n.value)==null||h.scrollToTop(y),(g=o.value)==null||g.scrollToTop(y)}function a(v){l.value=v,s(v)}function u(v){l.value.scrollTop=v,s(i(l))}function c(v){var m,h;l.value.scrollLeft=v,(h=(m=t.value)==null?void 0:m.scrollTo)==null||h.call(m,i(l))}function d(v){var m;a(v),(m=e.onScroll)==null||m.call(e,v)}function f({scrollTop:v}){const{scrollTop:m}=i(l);v!==m&&u(v)}function p(v,m="auto"){var h;(h=t.value)==null||h.scrollToRow(v,m)}return me(()=>i(l).scrollTop,(v,m)=>{v>m&&r()}),{scrollPos:l,scrollTo:a,scrollToLeft:c,scrollToTop:u,scrollToRow:p,onScroll:d,onVerticalScroll:f}},yG=(e,{mainTableRef:t,leftTableRef:n,rightTableRef:o})=>{const r=ut(),{emit:l}=r,s=Pt(!1),a=Pt(null),u=N(e.defaultExpandedRowKeys||[]),c=N(-1),d=Pt(null),f=N({}),p=N({}),v=Pt({}),m=Pt({}),h=Pt({}),g=C(()=>Xe(e.estimatedRowHeight));function y(O){var P;(P=e.onRowsRendered)==null||P.call(e,O),O.rowCacheEnd>i(c)&&(c.value=O.rowCacheEnd)}function w({hovered:O,rowKey:P}){a.value=O?P:null}function b({expanded:O,rowData:P,rowIndex:A,rowKey:V}){var B,D;const H=[...i(u)],W=H.indexOf(V);O?W===-1&&H.push(V):W>-1&&H.splice(W,1),u.value=H,l("update:expandedRowKeys",H),(B=e.onRowExpand)==null||B.call(e,{expanded:O,rowData:P,rowIndex:A,rowKey:V}),(D=e.onExpandedRowsChange)==null||D.call(e,H)}const _=$n(()=>{var O,P,A,V;s.value=!0,f.value={...i(f),...i(p)},k(i(d),!1),p.value={},d.value=null,(O=t.value)==null||O.forceUpdate(),(P=n.value)==null||P.forceUpdate(),(A=o.value)==null||A.forceUpdate(),(V=r.proxy)==null||V.$forceUpdate(),s.value=!1},0);function k(O,P=!1){i(g)&&[t,n,o].forEach(A=>{const V=i(A);V&&V.resetAfterRowIndex(O,P)})}function $(O,P,A){const V=i(d);(V===null||V>A)&&(d.value=A),p.value[O]=P}function M({rowKey:O,height:P,rowIndex:A},V){V?V===E_.RIGHT?h.value[O]=P:v.value[O]=P:m.value[O]=P;const B=Math.max(...[v,h,m].map(D=>D.value[O]||0));i(f)[O]!==B&&($(O,B,A),_())}return{hoveringRowKey:a,expandedRowKeys:u,lastRenderedRowIndex:c,isDynamic:g,isResetting:s,rowHeights:f,resetAfterIndex:k,onRowExpanded:b,onRowHovered:w,onRowsRendered:y,onRowHeightChange:M}},bG=(e,{expandedRowKeys:t,lastRenderedRowIndex:n,resetAfterIndex:o})=>{const r=N({}),l=C(()=>{const a={},{data:u,rowKey:c}=e,d=i(t);if(!d||!d.length)return u;const f=[],p=new Set;d.forEach(m=>p.add(m));let v=u.slice();for(v.forEach(m=>a[m[c]]=0);v.length>0;){const m=v.shift();f.push(m),p.has(m[c])&&Array.isArray(m.children)&&m.children.length>0&&(v=[...m.children,...v],m.children.forEach(h=>a[h[c]]=a[m[c]]+1))}return r.value=a,f}),s=C(()=>{const{data:a,expandColumnKey:u}=e;return u?i(l):a});return me(s,(a,u)=>{a!==u&&(n.value=-1,o(0,!0))}),{data:s,depthMap:r}},wG=(e,t)=>e+t,tu=e=>Ve(e)?e.reduce(wG,0):e,ml=(e,t,n={})=>Je(e)?e(t):e??n,br=e=>(["width","maxWidth","minWidth","height"].forEach(t=>{e[t]=qt(e[t])}),e),T_=e=>zt(e)?t=>je(e,t):e,_G=(e,{columnsTotalWidth:t,data:n,fixedColumnsOnLeft:o,fixedColumnsOnRight:r})=>{const l=C(()=>{const{fixed:b,width:_,vScrollbarSize:k}=e,$=_-k;return b?Math.max(Math.round(i(t)),$):$}),s=C(()=>i(l)+(e.fixed?e.vScrollbarSize:0)),a=C(()=>{const{height:b=0,maxHeight:_=0,footerHeight:k,hScrollbarSize:$}=e;if(_>0){const M=i(m),O=i(u),A=i(v)+M+O+$;return Math.min(A,_-k)}return b-k}),u=C(()=>{const{rowHeight:b,estimatedRowHeight:_}=e,k=i(n);return Xe(_)?k.length*_:k.length*b}),c=C(()=>{const{maxHeight:b}=e,_=i(a);if(Xe(b)&&b>0)return _;const k=i(u)+i(v)+i(m);return Math.min(_,k)}),d=b=>b.width,f=C(()=>tu(i(o).map(d))),p=C(()=>tu(i(r).map(d))),v=C(()=>tu(e.headerHeight)),m=C(()=>{var b;return(((b=e.fixedData)==null?void 0:b.length)||0)*e.rowHeight}),h=C(()=>i(a)-i(v)-i(m)),g=C(()=>{const{style:b={},height:_,width:k}=e;return br({...b,height:_,width:k})}),y=C(()=>br({height:e.footerHeight})),w=C(()=>({top:qt(i(v)),bottom:qt(e.footerHeight),width:qt(e.width)}));return{bodyWidth:l,fixedTableHeight:c,mainTableHeight:a,leftTableWidth:f,rightTableWidth:p,headerWidth:s,rowsHeight:u,windowHeight:h,footerHeight:y,emptyStyle:w,rootStyle:g,headerHeight:v}},CG=e=>{const t=N(),n=N(0),o=N(0);let r;return tt(()=>{r=gn(t,([l])=>{const{width:s,height:a}=l.contentRect,{paddingLeft:u,paddingRight:c,paddingTop:d,paddingBottom:f}=getComputedStyle(l.target),p=Number.parseInt(u)||0,v=Number.parseInt(c)||0,m=Number.parseInt(d)||0,h=Number.parseInt(f)||0;n.value=s-p-v,o.value=a-m-h}).stop}),Dt(()=>{r==null||r()}),me([n,o],([l,s])=>{var a;(a=e.onResize)==null||a.call(e,{width:l,height:s})}),{sizer:t,width:n,height:o}};function SG(e){const t=N(),n=N(),o=N(),{columns:r,columnsStyles:l,columnsTotalWidth:s,fixedColumnsOnLeft:a,fixedColumnsOnRight:u,hasFixedColumns:c,mainColumns:d,onColumnSorted:f}=mG(e,Lt(e,"columns"),Lt(e,"fixed")),{scrollTo:p,scrollToLeft:v,scrollToTop:m,scrollToRow:h,onScroll:g,onVerticalScroll:y,scrollPos:w}=gG(e,{mainTableRef:t,leftTableRef:n,rightTableRef:o,onMaybeEndReached:K}),{expandedRowKeys:b,hoveringRowKey:_,lastRenderedRowIndex:k,isDynamic:$,isResetting:M,rowHeights:O,resetAfterIndex:P,onRowExpanded:A,onRowHeightChange:V,onRowHovered:B,onRowsRendered:D}=yG(e,{mainTableRef:t,leftTableRef:n,rightTableRef:o}),{data:H,depthMap:W}=bG(e,{expandedRowKeys:b,lastRenderedRowIndex:k,resetAfterIndex:P}),{bodyWidth:F,fixedTableHeight:T,mainTableHeight:L,leftTableWidth:R,rightTableWidth:U,headerWidth:ne,rowsHeight:j,windowHeight:Q,footerHeight:he,emptyStyle:ee,rootStyle:Z,headerHeight:te}=_G(e,{columnsTotalWidth:s,data:H,fixedColumnsOnLeft:a,fixedColumnsOnRight:u}),X=Pt(!1),le=N(),de=C(()=>{const J=i(H).length===0;return Ve(e.fixedData)?e.fixedData.length===0&&J:J});function Ie(J){const{estimatedRowHeight:fe,rowHeight:ge,rowKey:Oe}=e;return fe?i(O)[i(H)[J][Oe]]||fe:ge}function K(){const{onEndReached:J}=e;if(!J)return;const{scrollTop:fe}=i(w),ge=i(j),Oe=i(Q),ce=ge-(fe+Oe)+e.hScrollbarSize;i(k)>=0&&ge===fe+i(L)-i(te)&&J(ce)}return me(()=>e.expandedRowKeys,J=>b.value=J,{deep:!0}),{columns:r,containerRef:le,mainTableRef:t,leftTableRef:n,rightTableRef:o,isDynamic:$,isResetting:M,isScrolling:X,hoveringRowKey:_,hasFixedColumns:c,columnsStyles:l,columnsTotalWidth:s,data:H,expandedRowKeys:b,depthMap:W,fixedColumnsOnLeft:a,fixedColumnsOnRight:u,mainColumns:d,bodyWidth:F,emptyStyle:ee,rootStyle:Z,headerWidth:ne,footerHeight:he,mainTableHeight:L,fixedTableHeight:T,leftTableWidth:R,rightTableWidth:U,showEmpty:de,getRowHeight:Ie,onColumnSorted:f,onRowHovered:B,onRowExpanded:A,onRowsRendered:D,onRowHeightChange:V,scrollTo:p,scrollToLeft:v,scrollToTop:m,scrollToRow:h,onScroll:g,onVerticalScroll:y}}const Lh=Symbol("tableV2"),O_=String,ni={type:se(Array),required:!0},Dh={type:se(Array)},N_={...Dh,required:!0},kG=String,hy={type:se(Array),default:()=>Ft([])},Jr={type:Number,required:!0},M_={type:se([String,Number,Symbol]),default:"id"},vy={type:se(Object)},rl=Me({class:String,columns:ni,columnsStyles:{type:se(Object),required:!0},depth:Number,expandColumnKey:kG,estimatedRowHeight:{...cl.estimatedRowHeight,default:void 0},isScrolling:Boolean,onRowExpand:{type:se(Function)},onRowHover:{type:se(Function)},onRowHeightChange:{type:se(Function)},rowData:{type:se(Object),required:!0},rowEventHandlers:{type:se(Object)},rowIndex:{type:Number,required:!0},rowKey:M_,style:{type:se(Object)}}),ad={type:Number,required:!0},Bh=Me({class:String,columns:ni,fixedHeaderData:{type:se(Array)},headerData:{type:se(Array),required:!0},headerHeight:{type:se([Number,Array]),default:50},rowWidth:ad,rowHeight:{type:Number,default:50},height:ad,width:ad}),nu=Me({columns:ni,data:N_,fixedData:Dh,estimatedRowHeight:rl.estimatedRowHeight,width:Jr,height:Jr,headerWidth:Jr,headerHeight:Bh.headerHeight,bodyWidth:Jr,rowHeight:Jr,cache:e_.cache,useIsScrolling:Boolean,scrollbarAlwaysOn:cl.scrollbarAlwaysOn,scrollbarStartGap:cl.scrollbarStartGap,scrollbarEndGap:cl.scrollbarEndGap,class:O_,style:vy,containerStyle:vy,getRowHeight:{type:se(Function),required:!0},rowKey:rl.rowKey,onRowsRendered:{type:se(Function)},onScroll:{type:se(Function)}}),$G=Me({cache:nu.cache,estimatedRowHeight:rl.estimatedRowHeight,rowKey:M_,headerClass:{type:se([String,Function])},headerProps:{type:se([Object,Function])},headerCellProps:{type:se([Object,Function])},headerHeight:Bh.headerHeight,footerHeight:{type:Number,default:0},rowClass:{type:se([String,Function])},rowProps:{type:se([Object,Function])},rowHeight:{type:Number,default:50},cellProps:{type:se([Object,Function])},columns:ni,data:N_,dataGetter:{type:se(Function)},fixedData:Dh,expandColumnKey:rl.expandColumnKey,expandedRowKeys:hy,defaultExpandedRowKeys:hy,class:O_,fixed:Boolean,style:{type:se(Object)},width:Jr,height:Jr,maxHeight:Number,useIsScrolling:Boolean,indentSize:{type:Number,default:12},iconSize:{type:Number,default:12},hScrollbarSize:cl.hScrollbarSize,vScrollbarSize:cl.vScrollbarSize,scrollbarAlwaysOn:o_.alwaysOn,sortBy:{type:se(Object),default:()=>({})},sortState:{type:se(Object),default:void 0},onColumnSort:{type:se(Function)},onExpandedRowsChange:{type:se(Function)},onEndReached:{type:se(Function)},onRowExpand:rl.onRowExpand,onScroll:nu.onScroll,onRowsRendered:nu.onRowsRendered,rowEventHandlers:rl.rowEventHandlers}),Fh=(e,{slots:t})=>{var n;const{cellData:o,style:r}=e,l=((n=o==null?void 0:o.toString)==null?void 0:n.call(o))||"";return z("div",{class:e.class,title:l,style:r},[t.default?t.default(e):l])};Fh.displayName="ElTableV2Cell";Fh.inheritAttrs=!1;const Vh=(e,{slots:t})=>{var n,o;return t.default?t.default(e):z("div",{class:e.class,title:(n=e.column)==null?void 0:n.title},[(o=e.column)==null?void 0:o.title])};Vh.displayName="ElTableV2HeaderCell";Vh.inheritAttrs=!1;const EG=Me({class:String,columns:ni,columnsStyles:{type:se(Object),required:!0},headerIndex:Number,style:{type:se(Object)}}),TG=G({name:"ElTableV2HeaderRow",props:EG,setup(e,{slots:t}){return()=>{const{columns:n,columnsStyles:o,headerIndex:r,style:l}=e;let s=n.map((a,u)=>t.cell({columns:n,column:a,columnIndex:u,headerIndex:r,style:o[a.key]}));return t.header&&(s=t.header({cells:s.map(a=>Ve(a)&&a.length===1?a[0]:a),columns:n,headerIndex:r})),z("div",{class:e.class,style:l,role:"row"},[s])}}}),OG="ElTableV2Header",NG=G({name:OG,props:Bh,setup(e,{slots:t,expose:n}){const o=ye("table-v2"),r=N(),l=C(()=>br({width:e.width,height:e.height})),s=C(()=>br({width:e.rowWidth,height:e.height})),a=C(()=>ns(i(e.headerHeight))),u=f=>{const p=i(r);Ke(()=>{p!=null&&p.scroll&&p.scroll({left:f})})},c=()=>{const f=o.e("fixed-header-row"),{columns:p,fixedHeaderData:v,rowHeight:m}=e;return v==null?void 0:v.map((h,g)=>{var y;const w=br({height:m,width:"100%"});return(y=t.fixed)==null?void 0:y.call(t,{class:f,columns:p,rowData:h,rowIndex:-(g+1),style:w})})},d=()=>{const f=o.e("dynamic-header-row"),{columns:p}=e;return i(a).map((v,m)=>{var h;const g=br({width:"100%",height:v});return(h=t.dynamic)==null?void 0:h.call(t,{class:f,columns:p,headerIndex:m,style:g})})};return n({scrollToLeft:u}),()=>{if(!(e.height<=0))return z("div",{ref:r,class:e.class,style:i(l),role:"rowgroup"},[z("div",{style:i(s),class:o.e("header")},[d(),c()])])}}}),MG=e=>{const{isScrolling:t}=De(Lh),n=N(!1),o=N(),r=C(()=>Xe(e.estimatedRowHeight)&&e.rowIndex>=0),l=(u=!1)=>{const c=i(o);if(!c)return;const{columns:d,onRowHeightChange:f,rowKey:p,rowIndex:v,style:m}=e,{height:h}=c.getBoundingClientRect();n.value=!0,Ke(()=>{if(u||h!==Number.parseInt(m.height)){const g=d[0],y=(g==null?void 0:g.placeholderSign)===xa;f==null||f({rowKey:p,height:h,rowIndex:v},g&&!y&&g.fixed)}})},s=C(()=>{const{rowData:u,rowIndex:c,rowKey:d,onRowHover:f}=e,p=e.rowEventHandlers||{},v={};return Object.entries(p).forEach(([m,h])=>{Je(h)&&(v[m]=g=>{h({event:g,rowData:u,rowIndex:c,rowKey:d})})}),f&&[{name:"onMouseleave",hovered:!1},{name:"onMouseenter",hovered:!0}].forEach(({name:m,hovered:h})=>{const g=v[m];v[m]=y=>{f({event:y,hovered:h,rowData:u,rowIndex:c,rowKey:d}),g==null||g(y)}}),v}),a=u=>{const{onRowExpand:c,rowData:d,rowIndex:f,rowKey:p}=e;c==null||c({expanded:u,rowData:d,rowIndex:f,rowKey:p})};return tt(()=>{i(r)&&l(!0)}),{isScrolling:t,measurable:r,measured:n,rowRef:o,eventHandlers:s,onExpand:a}},IG="ElTableV2TableRow",PG=G({name:IG,props:rl,setup(e,{expose:t,slots:n,attrs:o}){const{eventHandlers:r,isScrolling:l,measurable:s,measured:a,rowRef:u,onExpand:c}=MG(e);return t({onExpand:c}),()=>{const{columns:d,columnsStyles:f,expandColumnKey:p,depth:v,rowData:m,rowIndex:h,style:g}=e;let y=d.map((w,b)=>{const _=Ve(m.children)&&m.children.length>0&&w.key===p;return n.cell({column:w,columns:d,columnIndex:b,depth:v,style:f[w.key],rowData:m,rowIndex:h,isScrolling:i(l),expandIconProps:_?{rowData:m,rowIndex:h,onExpand:c}:void 0})});if(n.row&&(y=n.row({cells:y.map(w=>Ve(w)&&w.length===1?w[0]:w),style:g,columns:d,depth:v,rowData:m,rowIndex:h,isScrolling:i(l)})),i(s)){const{height:w,...b}=g||{},_=i(a);return z("div",pt({ref:u,class:e.class,style:_?g:b,role:"row"},o,i(r)),[y])}return z("div",pt(o,{ref:u,class:e.class,style:g,role:"row"},i(r)),[y])}}}),RG=e=>{const{sortOrder:t}=e;return z(ze,{size:14,class:e.class},{default:()=>[t===Ra.ASC?z(rA,null,null):z(ZR,null,null)]})},AG=e=>{const{expanded:t,expandable:n,onExpand:o,style:r,size:l}=e,s={onClick:n?()=>o(!t):void 0,class:e.class};return z(ze,pt(s,{size:l,style:r}),{default:()=>[z(_n,null,null)]})},xG="ElTableV2Grid",LG=e=>{const t=N(),n=N(),o=C(()=>{const{data:h,rowHeight:g,estimatedRowHeight:y}=e;if(!y)return h.length*g}),r=C(()=>{const{fixedData:h,rowHeight:g}=e;return((h==null?void 0:h.length)||0)*g}),l=C(()=>tu(e.headerHeight)),s=C(()=>{const{height:h}=e;return Math.max(0,h-i(l)-i(r))}),a=C(()=>i(l)+i(r)>0),u=({data:h,rowIndex:g})=>h[g][e.rowKey];function c({rowCacheStart:h,rowCacheEnd:g,rowVisibleStart:y,rowVisibleEnd:w}){var b;(b=e.onRowsRendered)==null||b.call(e,{rowCacheStart:h,rowCacheEnd:g,rowVisibleStart:y,rowVisibleEnd:w})}function d(h,g){var y;(y=n.value)==null||y.resetAfterRowIndex(h,g)}function f(h,g){const y=i(t),w=i(n);!y||!w||(ft(h)?(y.scrollToLeft(h.scrollLeft),w.scrollTo(h)):(y.scrollToLeft(h),w.scrollTo({scrollLeft:h,scrollTop:g})))}function p(h){var g;(g=i(n))==null||g.scrollTo({scrollTop:h})}function v(h,g){var y;(y=i(n))==null||y.scrollToItem(h,1,g)}function m(){var h,g;(h=i(n))==null||h.$forceUpdate(),(g=i(t))==null||g.$forceUpdate()}return{bodyRef:n,forceUpdate:m,fixedRowHeight:r,gridHeight:s,hasHeader:a,headerHeight:l,headerRef:t,totalHeight:o,itemKey:u,onItemRendered:c,resetAfterRowIndex:d,scrollTo:f,scrollToTop:p,scrollToRow:v}},zh=G({name:xG,props:nu,setup(e,{slots:t,expose:n}){const{ns:o}=De(Lh),{bodyRef:r,fixedRowHeight:l,gridHeight:s,hasHeader:a,headerRef:u,headerHeight:c,totalHeight:d,forceUpdate:f,itemKey:p,onItemRendered:v,resetAfterRowIndex:m,scrollTo:h,scrollToTop:g,scrollToRow:y}=LG(e);n({forceUpdate:f,totalHeight:d,scrollTo:h,scrollToTop:g,scrollToRow:y,resetAfterRowIndex:m});const w=()=>e.bodyWidth;return()=>{const{cache:b,columns:_,data:k,fixedData:$,useIsScrolling:M,scrollbarAlwaysOn:O,scrollbarEndGap:P,scrollbarStartGap:A,style:V,rowHeight:B,bodyWidth:D,estimatedRowHeight:H,headerWidth:W,height:F,width:T,getRowHeight:L,onScroll:R}=e,U=Xe(H),ne=U?pU:uU,j=i(c);return z("div",{role:"table",class:[o.e("table"),e.class],style:V},[z(ne,{ref:r,data:k,useIsScrolling:M,itemKey:p,columnCache:0,columnWidth:U?w:D,totalColumn:1,totalRow:k.length,rowCache:b,rowHeight:U?L:B,width:T,height:i(s),class:o.e("body"),role:"rowgroup",scrollbarStartGap:A,scrollbarEndGap:P,scrollbarAlwaysOn:O,onScroll:R,onItemRendered:v,perfMode:!1},{default:Q=>{var he;const ee=k[Q.rowIndex];return(he=t.row)==null?void 0:he.call(t,{...Q,columns:_,rowData:ee})}}),i(a)&&z(NG,{ref:u,class:o.e("header-wrapper"),columns:_,headerData:k,headerHeight:e.headerHeight,fixedHeaderData:$,rowWidth:W,rowHeight:B,width:T,height:Math.min(j+i(l),F)},{dynamic:t.header,fixed:t.row})])}}});function DG(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const BG=(e,{slots:t})=>{const{mainTableRef:n,...o}=e;return z(zh,pt({ref:n},o),DG(t)?t:{default:()=>[t]})};function FG(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const VG=(e,{slots:t})=>{if(!e.columns.length)return;const{leftTableRef:n,...o}=e;return z(zh,pt({ref:n},o),FG(t)?t:{default:()=>[t]})};function zG(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const HG=(e,{slots:t})=>{if(!e.columns.length)return;const{rightTableRef:n,...o}=e;return z(zh,pt({ref:n},o),zG(t)?t:{default:()=>[t]})};function KG(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const jG=(e,{slots:t})=>{const{columns:n,columnsStyles:o,depthMap:r,expandColumnKey:l,expandedRowKeys:s,estimatedRowHeight:a,hasFixedColumns:u,hoveringRowKey:c,rowData:d,rowIndex:f,style:p,isScrolling:v,rowProps:m,rowClass:h,rowKey:g,rowEventHandlers:y,ns:w,onRowHovered:b,onRowExpanded:_}=e,k=ml(h,{columns:n,rowData:d,rowIndex:f},""),$=ml(m,{columns:n,rowData:d,rowIndex:f}),M=d[g],O=r[M]||0,P=!!l,A=f<0,V=[w.e("row"),k,{[w.e(`row-depth-${O}`)]:P&&f>=0,[w.is("expanded")]:P&&s.includes(M),[w.is("hovered")]:!v&&M===c,[w.is("fixed")]:!O&&A,[w.is("customized")]:!!t.row}],B=u?b:void 0,D={...$,columns:n,columnsStyles:o,class:V,depth:O,expandColumnKey:l,estimatedRowHeight:A?void 0:a,isScrolling:v,rowIndex:f,rowData:d,rowKey:M,rowEventHandlers:y,style:p};return z(PG,pt(D,{onRowHover:B,onRowExpand:_}),KG(t)?t:{default:()=>[t]})},Df=({columns:e,column:t,columnIndex:n,depth:o,expandIconProps:r,isScrolling:l,rowData:s,rowIndex:a,style:u,expandedRowKeys:c,ns:d,cellProps:f,expandColumnKey:p,indentSize:v,iconSize:m,rowKey:h},{slots:g})=>{const y=br(u);if(t.placeholderSign===xa)return z("div",{class:d.em("row-cell","placeholder"),style:y},null);const{cellRenderer:w,dataKey:b,dataGetter:_}=t,$=T_(w)||g.default||(F=>z(Fh,F,null)),M=Je(_)?_({columns:e,column:t,columnIndex:n,rowData:s,rowIndex:a}):Bt(s,b??""),O=ml(f,{cellData:M,columns:e,column:t,columnIndex:n,rowIndex:a,rowData:s}),P={class:d.e("cell-text"),columns:e,column:t,columnIndex:n,cellData:M,isScrolling:l,rowData:s,rowIndex:a},A=$(P),V=[d.e("row-cell"),t.class,t.align===Aa.CENTER&&d.is("align-center"),t.align===Aa.RIGHT&&d.is("align-right")],B=a>=0&&t.key===p,D=a>=0&&c.includes(s[h]);let H;const W=`margin-inline-start: ${o*v}px;`;return B&&(ft(r)?H=z(AG,pt(r,{class:[d.e("expand-icon"),d.is("expanded",D)],size:m,expanded:D,style:W,expandable:!0}),null):H=z("div",{style:[W,`width: ${m}px; height: ${m}px;`].join(" ")},null)),z("div",pt({class:V,style:y},O,{role:"cell"}),[H,A])};Df.inheritAttrs=!1;function WG(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const UG=({columns:e,columnsStyles:t,headerIndex:n,style:o,headerClass:r,headerProps:l,ns:s},{slots:a})=>{const u={columns:e,headerIndex:n},c=[s.e("header-row"),ml(r,u,""),{[s.is("customized")]:!!a.header}],d={...ml(l,u),columnsStyles:t,class:c,columns:e,headerIndex:n,style:o};return z(TG,d,WG(a)?a:{default:()=>[a]})},my=(e,{slots:t})=>{const{column:n,ns:o,style:r,onColumnSorted:l}=e,s=br(r);if(n.placeholderSign===xa)return z("div",{class:o.em("header-row-cell","placeholder"),style:s},null);const{headerCellRenderer:a,headerClass:u,sortable:c}=n,d={...e,class:o.e("header-cell-text")},p=(T_(a)||t.default||(_=>z(Vh,_,null)))(d),{sortBy:v,sortState:m,headerCellProps:h}=e;let g,y;if(m){const _=m[n.key];g=!!Lf[_],y=g?_:Ra.ASC}else g=n.key===v.key,y=g?v.order:Ra.ASC;const w=[o.e("header-cell"),ml(u,e,""),n.align===Aa.CENTER&&o.is("align-center"),n.align===Aa.RIGHT&&o.is("align-right"),c&&o.is("sortable")],b={...ml(h,e),onClick:n.sortable?l:void 0,class:w,style:s,["data-key"]:n.key};return z("div",pt(b,{role:"columnheader"}),[p,c&&z(RG,{class:[o.e("sort-icon"),g&&o.is("sorting")],sortOrder:y},null)])},I_=(e,{slots:t})=>{var n;return z("div",{class:e.class,style:e.style},[(n=t.default)==null?void 0:n.call(t)])};I_.displayName="ElTableV2Footer";const P_=(e,{slots:t})=>z("div",{class:e.class,style:e.style},[t.default?t.default():z(Sc,null,null)]);P_.displayName="ElTableV2Empty";const R_=(e,{slots:t})=>{var n;return z("div",{class:e.class,style:e.style},[(n=t.default)==null?void 0:n.call(t)])};R_.displayName="ElTableV2Overlay";function xs(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!zt(e)}const qG="ElTableV2",YG=G({name:qG,props:$G,setup(e,{slots:t,expose:n}){const o=ye("table-v2"),{columnsStyles:r,fixedColumnsOnLeft:l,fixedColumnsOnRight:s,mainColumns:a,mainTableHeight:u,fixedTableHeight:c,leftTableWidth:d,rightTableWidth:f,data:p,depthMap:v,expandedRowKeys:m,hasFixedColumns:h,hoveringRowKey:g,mainTableRef:y,leftTableRef:w,rightTableRef:b,isDynamic:_,isResetting:k,isScrolling:$,bodyWidth:M,emptyStyle:O,rootStyle:P,headerWidth:A,footerHeight:V,showEmpty:B,scrollTo:D,scrollToLeft:H,scrollToTop:W,scrollToRow:F,getRowHeight:T,onColumnSorted:L,onRowHeightChange:R,onRowHovered:U,onRowExpanded:ne,onRowsRendered:j,onScroll:Q,onVerticalScroll:he}=SG(e);return n({scrollTo:D,scrollToLeft:H,scrollToTop:W,scrollToRow:F}),ht(Lh,{ns:o,isResetting:k,hoveringRowKey:g,isScrolling:$}),()=>{const{cache:ee,cellProps:Z,estimatedRowHeight:te,expandColumnKey:X,fixedData:le,headerHeight:de,headerClass:Ie,headerProps:K,headerCellProps:J,sortBy:fe,sortState:ge,rowHeight:Oe,rowClass:ce,rowEventHandlers:Te,rowKey:be,rowProps:Ee,scrollbarAlwaysOn:_e,indentSize:Le,iconSize:Re,useIsScrolling:pe,vScrollbarSize:Ae,width:qe}=e,rt=i(p),Ye={cache:ee,class:o.e("main"),columns:i(a),data:rt,fixedData:le,estimatedRowHeight:te,bodyWidth:i(M),headerHeight:de,headerWidth:i(A),height:i(u),mainTableRef:y,rowKey:be,rowHeight:Oe,scrollbarAlwaysOn:_e,scrollbarStartGap:2,scrollbarEndGap:Ae,useIsScrolling:pe,width:qe,getRowHeight:T,onRowsRendered:j,onScroll:Q},Se=i(d),ke=i(c),ie={cache:ee,class:o.e("left"),columns:i(l),data:rt,estimatedRowHeight:te,leftTableRef:w,rowHeight:Oe,bodyWidth:Se,headerWidth:Se,headerHeight:de,height:ke,rowKey:be,scrollbarAlwaysOn:_e,scrollbarStartGap:2,scrollbarEndGap:Ae,useIsScrolling:pe,width:Se,getRowHeight:T,onScroll:he},re=i(f)+Ae,Ce={cache:ee,class:o.e("right"),columns:i(s),data:rt,estimatedRowHeight:te,rightTableRef:b,rowHeight:Oe,bodyWidth:re,headerWidth:re,headerHeight:de,height:ke,rowKey:be,scrollbarAlwaysOn:_e,scrollbarStartGap:2,scrollbarEndGap:Ae,width:re,style:`--${i(o.namespace)}-table-scrollbar-size: ${Ae}px`,useIsScrolling:pe,getRowHeight:T,onScroll:he},Pe=i(r),ot={ns:o,depthMap:i(v),columnsStyles:Pe,expandColumnKey:X,expandedRowKeys:i(m),estimatedRowHeight:te,hasFixedColumns:i(h),hoveringRowKey:i(g),rowProps:Ee,rowClass:ce,rowKey:be,rowEventHandlers:Te,onRowHovered:U,onRowExpanded:ne,onRowHeightChange:R},we={cellProps:Z,expandColumnKey:X,indentSize:Le,iconSize:Re,rowKey:be,expandedRowKeys:i(m),ns:o},Fe={ns:o,headerClass:Ie,headerProps:K,columnsStyles:Pe},at={ns:o,sortBy:fe,sortState:ge,headerCellProps:J,onColumnSorted:L},ct={row:tn=>z(jG,pt(tn,ot),{row:t.row,cell:$e=>{let Ue;return t.cell?z(Df,pt($e,we,{style:Pe[$e.column.key]}),xs(Ue=t.cell($e))?Ue:{default:()=>[Ue]}):z(Df,pt($e,we,{style:Pe[$e.column.key]}),null)}}),header:tn=>z(UG,pt(tn,Fe),{header:t.header,cell:$e=>{let Ue;return t["header-cell"]?z(my,pt($e,at,{style:Pe[$e.column.key]}),xs(Ue=t["header-cell"]($e))?Ue:{default:()=>[Ue]}):z(my,pt($e,at,{style:Pe[$e.column.key]}),null)}})},mt=[e.class,o.b(),o.e("root"),{[o.is("dynamic")]:i(_)}],Tt={class:o.e("footer"),style:i(V)};return z("div",{class:mt,style:i(P)},[z(BG,Ye,xs(ct)?ct:{default:()=>[ct]}),z(VG,ie,xs(ct)?ct:{default:()=>[ct]}),z(HG,Ce,xs(ct)?ct:{default:()=>[ct]}),t.footer&&z(I_,Tt,{default:t.footer}),i(B)&&z(P_,{class:o.e("empty"),style:i(O)},{default:t.empty}),t.overlay&&z(R_,{class:o.e("overlay")},{default:t.overlay})])}}}),GG=Me({disableWidth:Boolean,disableHeight:Boolean,onResize:{type:se(Function)}}),XG=G({name:"ElAutoResizer",props:GG,setup(e,{slots:t}){const n=ye("auto-resizer"),{height:o,width:r,sizer:l}=CG(e),s={width:"100%",height:"100%"};return()=>{var a;return z("div",{ref:l,class:n.b(),style:s},[(a=t.default)==null?void 0:a.call(t,{height:o.value,width:r.value})])}}}),JG=it(YG),ZG=it(XG),$c=Symbol("tabsRootContextKey"),QG=Me({tabs:{type:se(Array),default:()=>Ft([])}}),A_="ElTabBar",eX=G({name:A_}),tX=G({...eX,props:QG,setup(e,{expose:t}){const n=e,o=ut(),r=De($c);r||en(A_," ");const l=ye("tabs"),s=N(),a=N(),u=()=>{let d=0,f=0;const p=["top","bottom"].includes(r.props.tabPosition)?"width":"height",v=p==="width"?"x":"y",m=v==="x"?"left":"top";return n.tabs.every(h=>{var g,y;const w=(y=(g=o.parent)==null?void 0:g.refs)==null?void 0:y[`tab-${h.uid}`];if(!w)return!1;if(!h.active)return!0;d=w[`offset${Eo(m)}`],f=w[`client${Eo(p)}`];const b=window.getComputedStyle(w);return p==="width"&&(n.tabs.length>1&&(f-=Number.parseFloat(b.paddingLeft)+Number.parseFloat(b.paddingRight)),d+=Number.parseFloat(b.paddingLeft)),!1}),{[p]:`${f}px`,transform:`translate${Eo(v)}(${d}px)`}},c=()=>a.value=u();return me(()=>n.tabs,async()=>{await Ke(),c()},{immediate:!0}),gn(s,()=>c()),t({ref:s,update:c}),(d,f)=>(S(),x("div",{ref_key:"barRef",ref:s,class:E([i(l).e("active-bar"),i(l).is(i(r).props.tabPosition)]),style:He(a.value)},null,6))}});var nX=Ne(tX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const oX=Me({panes:{type:se(Array),default:()=>Ft([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),rX={tabClick:(e,t,n)=>n instanceof Event,tabRemove:(e,t)=>t instanceof Event},gy="ElTabNav",lX=G({name:gy,props:oX,emits:rX,setup(e,{expose:t,emit:n}){const o=ut(),r=De($c);r||en(gy," ");const l=ye("tabs"),s=A$(),a=j$(),u=N(),c=N(),d=N(),f=N(),p=N(!1),v=N(0),m=N(!1),h=N(!0),g=C(()=>["top","bottom"].includes(r.props.tabPosition)?"width":"height"),y=C(()=>({transform:`translate${g.value==="width"?"X":"Y"}(-${v.value}px)`})),w=()=>{if(!u.value)return;const P=u.value[`offset${Eo(g.value)}`],A=v.value;if(!A)return;const V=A>P?A-P:0;v.value=V},b=()=>{if(!u.value||!c.value)return;const P=c.value[`offset${Eo(g.value)}`],A=u.value[`offset${Eo(g.value)}`],V=v.value;if(P-V<=A)return;const B=P-V>A*2?V+A:P-A;v.value=B},_=async()=>{const P=c.value;if(!p.value||!d.value||!u.value||!P)return;await Ke();const A=d.value.querySelector(".is-active");if(!A)return;const V=u.value,B=["top","bottom"].includes(r.props.tabPosition),D=A.getBoundingClientRect(),H=V.getBoundingClientRect(),W=B?P.offsetWidth-H.width:P.offsetHeight-H.height,F=v.value;let T=F;B?(D.leftH.right&&(T=F+D.right-H.right)):(D.topH.bottom&&(T=F+(D.bottom-H.bottom))),T=Math.max(T,0),v.value=Math.min(T,W)},k=()=>{var P;if(!c.value||!u.value)return;e.stretch&&((P=f.value)==null||P.update());const A=c.value[`offset${Eo(g.value)}`],V=u.value[`offset${Eo(g.value)}`],B=v.value;V0&&(v.value=0))},$=P=>{const A=P.code,{up:V,down:B,left:D,right:H}=We;if(![V,B,D,H].includes(A))return;const W=Array.from(P.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),F=W.indexOf(P.target);let T;A===D||A===V?F===0?T=W.length-1:T=F-1:F{h.value&&(m.value=!0)},O=()=>m.value=!1;return me(s,P=>{P==="hidden"?h.value=!1:P==="visible"&&setTimeout(()=>h.value=!0,50)}),me(a,P=>{P?setTimeout(()=>h.value=!0,50):h.value=!1}),gn(d,k),tt(()=>setTimeout(()=>_(),0)),er(()=>k()),t({scrollToActiveTab:_,removeFocus:O}),me(()=>e.panes,()=>o.update(),{flush:"post",deep:!0}),()=>{const P=p.value?[z("span",{class:[l.e("nav-prev"),l.is("disabled",!p.value.prev)],onClick:w},[z(ze,null,{default:()=>[z(Tr,null,null)]})]),z("span",{class:[l.e("nav-next"),l.is("disabled",!p.value.next)],onClick:b},[z(ze,null,{default:()=>[z(_n,null,null)]})])]:null,A=e.panes.map((V,B)=>{var D,H,W,F;const T=V.uid,L=V.props.disabled,R=(H=(D=V.props.name)!=null?D:V.index)!=null?H:`${B}`,U=!L&&(V.isClosable||e.editable);V.index=`${B}`;const ne=U?z(ze,{class:"is-icon-close",onClick:he=>n("tabRemove",V,he)},{default:()=>[z(vo,null,null)]}):null,j=((F=(W=V.slots).label)==null?void 0:F.call(W))||V.props.label,Q=!L&&V.active?0:-1;return z("div",{ref:`tab-${T}`,class:[l.e("item"),l.is(r.props.tabPosition),l.is("active",V.active),l.is("disabled",L),l.is("closable",U),l.is("focus",m.value)],id:`tab-${R}`,key:`tab-${T}`,"aria-controls":`pane-${R}`,role:"tab","aria-selected":V.active,tabindex:Q,onFocus:()=>M(),onBlur:()=>O(),onClick:he=>{O(),n("tabClick",V,R,he)},onKeydown:he=>{U&&(he.code===We.delete||he.code===We.backspace)&&n("tabRemove",V,he)}},[j,ne])});return z("div",{ref:d,class:[l.e("nav-wrap"),l.is("scrollable",!!p.value),l.is(r.props.tabPosition)]},[P,z("div",{class:l.e("nav-scroll"),ref:u},[z("div",{class:[l.e("nav"),l.is(r.props.tabPosition),l.is("stretch",e.stretch&&["top","bottom"].includes(r.props.tabPosition))],ref:c,style:y.value,role:"tablist",onKeydown:$},[e.type?null:z(nX,{ref:f,tabs:[...e.panes]},null),A])])])}}}),sX=Me({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:se(Function),default:()=>!0},stretch:Boolean}),id=e=>Ze(e)||Xe(e),aX={[dt]:e=>id(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>id(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>id(e),tabAdd:()=>!0};var iX=G({name:"ElTabs",props:sX,emits:aX,setup(e,{emit:t,slots:n,expose:o}){var r,l;const s=ye("tabs"),{children:a,addChild:u,removeChild:c}=J1(ut(),"ElTabPane"),d=N(),f=N((l=(r=e.modelValue)!=null?r:e.activeName)!=null?l:"0"),p=y=>{f.value=y,t(dt,y),t("tabChange",y)},v=async y=>{var w,b,_;if(!(f.value===y||an(y)))try{await((w=e.beforeLeave)==null?void 0:w.call(e,y,f.value))!==!1&&(p(y),(_=(b=d.value)==null?void 0:b.removeFocus)==null||_.call(b))}catch{}},m=(y,w,b)=>{y.props.disabled||(v(w),t("tabClick",y,b))},h=(y,w)=>{y.props.disabled||an(y.props.name)||(w.stopPropagation(),t("edit",y.props.name,"remove"),t("tabRemove",y.props.name))},g=()=>{t("edit",void 0,"add"),t("tabAdd")};return Ro({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},C(()=>!!e.activeName)),me(()=>e.activeName,y=>v(y)),me(()=>e.modelValue,y=>v(y)),me(f,async()=>{var y;await Ke(),(y=d.value)==null||y.scrollToActiveTab()}),ht($c,{props:e,currentName:f,registerPane:u,unregisterPane:c}),o({currentName:f}),()=>{const y=e.editable||e.addable?z("span",{class:s.e("new-tab"),tabindex:"0",onClick:g,onKeydown:_=>{_.code===We.enter&&g()}},[z(ze,{class:s.is("icon-plus")},{default:()=>[z(i1,null,null)]})]):null,w=z("div",{class:[s.e("header"),s.is(e.tabPosition)]},[y,z(lX,{ref:d,currentName:f.value,editable:e.editable,type:e.type,panes:a.value,stretch:e.stretch,onTabClick:m,onTabRemove:h},null)]),b=z("div",{class:s.e("content")},[ve(n,"default")]);return z("div",{class:[s.b(),s.m(e.tabPosition),{[s.m("card")]:e.type==="card",[s.m("border-card")]:e.type==="border-card"}]},[...e.tabPosition!=="bottom"?[w,b]:[b,w]])}}});const uX=Me({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),cX=["id","aria-hidden","aria-labelledby"],x_="ElTabPane",dX=G({name:x_}),fX=G({...dX,props:uX,setup(e){const t=e,n=ut(),o=cn(),r=De($c);r||en(x_,"usage: ");const l=ye("tab-pane"),s=N(),a=C(()=>t.closable||r.props.closable),u=Gv(()=>{var v;return r.currentName.value===((v=t.name)!=null?v:s.value)}),c=N(u.value),d=C(()=>{var v;return(v=t.name)!=null?v:s.value}),f=Gv(()=>!t.lazy||c.value||u.value);me(u,v=>{v&&(c.value=!0)});const p=yt({uid:n.uid,slots:o,props:t,paneName:d,active:u,index:s,isClosable:a});return tt(()=>{r.registerPane(p)}),Ar(()=>{r.unregisterPane(p.uid)}),(v,m)=>i(f)?et((S(),x("div",{key:0,id:`pane-${i(d)}`,class:E(i(l).b()),role:"tabpanel","aria-hidden":!i(u),"aria-labelledby":`tab-${i(d)}`},[ve(v.$slots,"default")],10,cX)),[[kt,i(u)]]):oe("v-if",!0)}});var L_=Ne(fX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const Hh=it(iX,{TabPane:L_}),Kh=jt(L_),pX=Me({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:Lo,default:""},truncated:{type:Boolean},tag:{type:String,default:"span"}}),hX=G({name:"ElText"}),vX=G({...hX,props:pX,setup(e){const t=e,n=Jt(),o=ye("text"),r=C(()=>[o.b(),o.m(t.type),o.m(n.value),o.is("truncated",t.truncated)]);return(l,s)=>(S(),ae(vt(l.tag),{class:E(i(r))},{default:q(()=>[ve(l.$slots,"default")]),_:3},8,["class"]))}});var mX=Ne(vX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/text/src/text.vue"]]);const gX=it(mX),yX=Me({format:{type:String,default:"HH:mm"},modelValue:String,disabled:Boolean,editable:{type:Boolean,default:!0},effect:{type:String,default:"light"},clearable:{type:Boolean,default:!0},size:hn,placeholder:String,start:{type:String,default:"09:00"},end:{type:String,default:"18:00"},step:{type:String,default:"00:30"},minTime:String,maxTime:String,name:String,prefixIcon:{type:se([String,Object]),default:()=>a1},clearIcon:{type:se([String,Object]),default:()=>Lr}}),Wo=e=>{const t=(e||"").split(":");if(t.length>=2){let n=Number.parseInt(t[0],10);const o=Number.parseInt(t[1],10),r=e.toUpperCase();return r.includes("AM")&&n===12?n=0:r.includes("PM")&&n!==12&&(n+=12),{hours:n,minutes:o}}return null},ud=(e,t)=>{const n=Wo(e);if(!n)return-1;const o=Wo(t);if(!o)return-1;const r=n.minutes+n.hours*60,l=o.minutes+o.hours*60;return r===l?0:r>l?1:-1},yy=e=>`${e}`.padStart(2,"0"),Pl=e=>`${yy(e.hours)}:${yy(e.minutes)}`,bX=(e,t)=>{const n=Wo(e);if(!n)return"";const o=Wo(t);if(!o)return"";const r={hours:n.hours,minutes:n.minutes};return r.minutes+=o.minutes,r.hours+=o.hours,r.hours+=Math.floor(r.minutes/60),r.minutes=r.minutes%60,Pl(r)},wX=G({name:"ElTimeSelect"}),_X=G({...wX,props:yX,emits:["change","blur","focus","update:modelValue"],setup(e,{expose:t}){const n=e;st.extend(hh);const{Option:o}=vl,r=ye("input"),l=N(),s=xn(),a=C(()=>n.modelValue),u=C(()=>{const g=Wo(n.start);return g?Pl(g):null}),c=C(()=>{const g=Wo(n.end);return g?Pl(g):null}),d=C(()=>{const g=Wo(n.step);return g?Pl(g):null}),f=C(()=>{const g=Wo(n.minTime||"");return g?Pl(g):null}),p=C(()=>{const g=Wo(n.maxTime||"");return g?Pl(g):null}),v=C(()=>{const g=[];if(n.start&&n.end&&n.step){let y=u.value,w;for(;y&&c.value&&ud(y,c.value)<=0;)w=st(y,"HH:mm").format(n.format),g.push({value:w,disabled:ud(y,f.value||"-1:-1")<=0||ud(y,p.value||"100:100")>=0}),y=bX(y,d.value)}return g});return t({blur:()=>{var g,y;(y=(g=l.value)==null?void 0:g.blur)==null||y.call(g)},focus:()=>{var g,y;(y=(g=l.value)==null?void 0:g.focus)==null||y.call(g)}}),(g,y)=>(S(),ae(i(vl),{ref_key:"select",ref:l,"model-value":i(a),disabled:i(s),clearable:g.clearable,"clear-icon":g.clearIcon,size:g.size,effect:g.effect,placeholder:g.placeholder,"default-first-option":"",filterable:g.editable,"onUpdate:modelValue":y[0]||(y[0]=w=>g.$emit("update:modelValue",w)),onChange:y[1]||(y[1]=w=>g.$emit("change",w)),onBlur:y[2]||(y[2]=w=>g.$emit("blur",w)),onFocus:y[3]||(y[3]=w=>g.$emit("focus",w))},{prefix:q(()=>[g.prefixIcon?(S(),ae(i(ze),{key:0,class:E(i(r).e("prefix-icon"))},{default:q(()=>[(S(),ae(vt(g.prefixIcon)))]),_:1},8,["class"])):oe("v-if",!0)]),default:q(()=>[(S(!0),x(xe,null,lt(i(v),w=>(S(),ae(i(o),{key:w.value,label:w.value,value:w.value,disabled:w.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["model-value","disabled","clearable","clear-icon","size","effect","placeholder","filterable"]))}});var ou=Ne(_X,[["__file","/home/runner/work/element-plus/element-plus/packages/components/time-select/src/time-select.vue"]]);ou.install=e=>{e.component(ou.name,ou)};const CX=ou,SX=CX,kX=G({name:"ElTimeline",setup(e,{slots:t}){const n=ye("timeline");return ht("timeline",t),()=>je("ul",{class:[n.b()]},[ve(t,"default")])}}),$X=Me({timestamp:{type:String,default:""},hideTimestamp:{type:Boolean,default:!1},center:{type:Boolean,default:!1},placement:{type:String,values:["top","bottom"],default:"bottom"},type:{type:String,values:["primary","success","warning","danger","info"],default:""},color:{type:String,default:""},size:{type:String,values:["normal","large"],default:"normal"},icon:{type:Rt},hollow:{type:Boolean,default:!1}}),EX=G({name:"ElTimelineItem"}),TX=G({...EX,props:$X,setup(e){const t=ye("timeline-item");return(n,o)=>(S(),x("li",{class:E([i(t).b(),{[i(t).e("center")]:n.center}])},[I("div",{class:E(i(t).e("tail"))},null,2),n.$slots.dot?oe("v-if",!0):(S(),x("div",{key:0,class:E([i(t).e("node"),i(t).em("node",n.size||""),i(t).em("node",n.type||""),i(t).is("hollow",n.hollow)]),style:He({backgroundColor:n.color})},[n.icon?(S(),ae(i(ze),{key:0,class:E(i(t).e("icon"))},{default:q(()=>[(S(),ae(vt(n.icon)))]),_:1},8,["class"])):oe("v-if",!0)],6)),n.$slots.dot?(S(),x("div",{key:1,class:E(i(t).e("dot"))},[ve(n.$slots,"dot")],2)):oe("v-if",!0),I("div",{class:E(i(t).e("wrapper"))},[!n.hideTimestamp&&n.placement==="top"?(S(),x("div",{key:0,class:E([i(t).e("timestamp"),i(t).is("top")])},ue(n.timestamp),3)):oe("v-if",!0),I("div",{class:E(i(t).e("content"))},[ve(n.$slots,"default")],2),!n.hideTimestamp&&n.placement==="bottom"?(S(),x("div",{key:1,class:E([i(t).e("timestamp"),i(t).is("bottom")])},ue(n.timestamp),3)):oe("v-if",!0)],2)],2))}});var D_=Ne(TX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/timeline/src/timeline-item.vue"]]);const OX=it(kX,{TimelineItem:D_}),NX=jt(D_),B_=Me({nowrap:Boolean});var F_=(e=>(e.top="top",e.bottom="bottom",e.left="left",e.right="right",e))(F_||{});const MX=Object.values(F_),jh=Me({width:{type:Number,default:10},height:{type:Number,default:10},style:{type:se(Object),default:null}}),IX=Me({side:{type:se(String),values:MX,required:!0}}),PX=["absolute","fixed"],RX=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],Wh=Me({ariaLabel:String,arrowPadding:{type:se(Number),default:5},effect:{type:String,default:""},contentClass:String,placement:{type:se(String),values:RX,default:"bottom"},reference:{type:se(Object),default:null},offset:{type:Number,default:8},strategy:{type:se(String),values:PX,default:"absolute"},showArrow:{type:Boolean,default:!1}}),Uh=Me({delayDuration:{type:Number,default:300},defaultOpen:Boolean,open:{type:Boolean,default:void 0},onOpenChange:{type:se(Function)},"onUpdate:open":{type:se(Function)}}),Ol={type:se(Function)},qh=Me({onBlur:Ol,onClick:Ol,onFocus:Ol,onMouseDown:Ol,onMouseEnter:Ol,onMouseLeave:Ol}),AX=Me({...Uh,...jh,...qh,...Wh,alwaysOn:Boolean,fullTransition:Boolean,transitionProps:{type:se(Object),default:null},teleported:Boolean,to:{type:se(String),default:"body"}}),Ec=Symbol("tooltipV2"),V_=Symbol("tooltipV2Content"),cd="tooltip_v2.open",xX=G({name:"ElTooltipV2Root"}),LX=G({...xX,props:Uh,setup(e,{expose:t}){const n=e,o=N(n.defaultOpen),r=N(null),l=C({get:()=>JN(n.open)?o.value:n.open,set:g=>{var y;o.value=g,(y=n["onUpdate:open"])==null||y.call(n,g)}}),s=C(()=>Xe(n.delayDuration)&&n.delayDuration>0),{start:a,stop:u}=pl(()=>{l.value=!0},C(()=>n.delayDuration),{immediate:!1}),c=ye("tooltip-v2"),d=no(),f=()=>{u(),l.value=!0},p=()=>{i(s)?a():f()},v=f,m=()=>{u(),l.value=!1};return me(l,g=>{var y;g&&(document.dispatchEvent(new CustomEvent(cd)),v()),(y=n.onOpenChange)==null||y.call(n,g)}),tt(()=>{document.addEventListener(cd,m)}),Dt(()=>{u(),document.removeEventListener(cd,m)}),ht(Ec,{contentId:d,triggerRef:r,ns:c,onClose:m,onDelayOpen:p,onOpen:v}),t({onOpen:v,onClose:m}),(g,y)=>ve(g.$slots,"default",{open:i(l)})}});var DX=Ne(LX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/root.vue"]]);const BX=G({name:"ElTooltipV2Arrow"}),FX=G({...BX,props:{...jh,...IX},setup(e){const t=e,{ns:n}=De(Ec),{arrowRef:o}=De(V_),r=C(()=>{const{style:l,width:s,height:a}=t,u=n.namespace.value;return{[`--${u}-tooltip-v2-arrow-width`]:`${s}px`,[`--${u}-tooltip-v2-arrow-height`]:`${a}px`,[`--${u}-tooltip-v2-arrow-border-width`]:`${s/2}px`,[`--${u}-tooltip-v2-arrow-cover-width`]:s/2-1,...l||{}}});return(l,s)=>(S(),x("span",{ref_key:"arrowRef",ref:o,style:He(i(r)),class:E(i(n).e("arrow"))},null,6))}});var by=Ne(FX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/arrow.vue"]]);const VX=Me({style:{type:se([String,Object,Array]),default:()=>({})}}),zX=G({name:"ElVisuallyHidden"}),HX=G({...zX,props:VX,setup(e){const t=e,n=C(()=>[t.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}]);return(o,r)=>(S(),x("span",pt(o.$attrs,{style:i(n)}),[ve(o.$slots,"default")],16))}});var KX=Ne(HX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/visual-hidden/src/visual-hidden.vue"]]);const jX=["data-side"],WX=G({name:"ElTooltipV2Content"}),UX=G({...WX,props:{...Wh,...B_},setup(e){const t=e,{triggerRef:n,contentId:o}=De(Ec),r=N(t.placement),l=N(t.strategy),s=N(null),{referenceRef:a,contentRef:u,middlewareData:c,x:d,y:f,update:p}=F8({placement:r,strategy:l,middleware:C(()=>{const b=[R8(t.offset)];return t.showArrow&&b.push(V8({arrowRef:s})),b})}),v=Sl().nextZIndex(),m=ye("tooltip-v2"),h=C(()=>r.value.split("-")[0]),g=C(()=>({position:i(l),top:`${i(f)||0}px`,left:`${i(d)||0}px`,zIndex:v})),y=C(()=>{if(!t.showArrow)return{};const{arrow:b}=i(c);return{[`--${m.namespace.value}-tooltip-v2-arrow-x`]:`${b==null?void 0:b.x}px`||"",[`--${m.namespace.value}-tooltip-v2-arrow-y`]:`${b==null?void 0:b.y}px`||""}}),w=C(()=>[m.e("content"),m.is("dark",t.effect==="dark"),m.is(i(l)),t.contentClass]);return me(s,()=>p()),me(()=>t.placement,b=>r.value=b),tt(()=>{me(()=>t.reference||n.value,b=>{a.value=b||void 0},{immediate:!0})}),ht(V_,{arrowRef:s}),(b,_)=>(S(),x("div",{ref_key:"contentRef",ref:u,style:He(i(g)),"data-tooltip-v2-root":""},[b.nowrap?oe("v-if",!0):(S(),x("div",{key:0,"data-side":i(h),class:E(i(w))},[ve(b.$slots,"default",{contentStyle:i(g),contentClass:i(w)}),z(i(KX),{id:i(o),role:"tooltip"},{default:q(()=>[b.ariaLabel?(S(),x(xe,{key:0},[nt(ue(b.ariaLabel),1)],64)):ve(b.$slots,"default",{key:1})]),_:3},8,["id"]),ve(b.$slots,"arrow",{style:He(i(y)),side:i(h)})],10,jX))],4))}});var wy=Ne(UX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/content.vue"]]);const qX=Me({setRef:{type:se(Function),required:!0},onlyChild:Boolean});var YX=G({props:qX,setup(e,{slots:t}){const n=N(),o=ic(n,r=>{r?e.setRef(r.nextElementSibling):e.setRef(null)});return()=>{var r;const[l]=((r=t.default)==null?void 0:r.call(t))||[],s=e.onlyChild?ox(l.children):l.children;return z(xe,{ref:o},[s])}}});const GX=G({name:"ElTooltipV2Trigger"}),XX=G({...GX,props:{...B_,...qh},setup(e){const t=e,{onClose:n,onOpen:o,onDelayOpen:r,triggerRef:l,contentId:s}=De(Ec);let a=!1;const u=w=>{l.value=w},c=()=>{a=!1},d=Kt(t.onMouseEnter,r),f=Kt(t.onMouseLeave,n),p=Kt(t.onMouseDown,()=>{n(),a=!0,document.addEventListener("mouseup",c,{once:!0})}),v=Kt(t.onFocus,()=>{a||o()}),m=Kt(t.onBlur,n),h=Kt(t.onClick,w=>{w.detail===0&&n()}),g={blur:m,click:h,focus:v,mousedown:p,mouseenter:d,mouseleave:f},y=(w,b,_)=>{w&&Object.entries(b).forEach(([k,$])=>{w[_](k,$)})};return me(l,(w,b)=>{y(w,g,"addEventListener"),y(b,g,"removeEventListener"),w&&w.setAttribute("aria-describedby",s.value)}),Dt(()=>{y(l.value,g,"removeEventListener"),document.removeEventListener("mouseup",c)}),(w,b)=>w.nowrap?(S(),ae(i(YX),{key:0,"set-ref":u,"only-child":""},{default:q(()=>[ve(w.$slots,"default")]),_:3})):(S(),x("button",pt({key:1,ref_key:"triggerRef",ref:l},w.$attrs),[ve(w.$slots,"default")],16))}});var JX=Ne(XX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/trigger.vue"]]);const ZX=G({name:"ElTooltipV2"}),QX=G({...ZX,props:AX,setup(e){const n=Qt(e),o=yt(Uo(n,Object.keys(jh))),r=yt(Uo(n,Object.keys(Wh))),l=yt(Uo(n,Object.keys(Uh))),s=yt(Uo(n,Object.keys(qh)));return(a,u)=>(S(),ae(DX,io(Xu(l)),{default:q(({open:c})=>[z(JX,pt(s,{nowrap:""}),{default:q(()=>[ve(a.$slots,"trigger")]),_:3},16),(S(),ae(Ha,{to:a.to,disabled:!a.teleported},[a.fullTransition?(S(),ae(Yt,io(pt({key:0},a.transitionProps)),{default:q(()=>[a.alwaysOn||c?(S(),ae(wy,io(pt({key:0},r)),{arrow:q(({style:d,side:f})=>[a.showArrow?(S(),ae(by,pt({key:0},o,{style:d,side:f}),null,16,["style","side"])):oe("v-if",!0)]),default:q(()=>[ve(a.$slots,"default")]),_:3},16)):oe("v-if",!0)]),_:2},1040)):(S(),x(xe,{key:1},[a.alwaysOn||c?(S(),ae(wy,io(pt({key:0},r)),{arrow:q(({style:d,side:f})=>[a.showArrow?(S(),ae(by,pt({key:0},o,{style:d,side:f}),null,16,["style","side"])):oe("v-if",!0)]),default:q(()=>[ve(a.$slots,"default")]),_:3},16)):oe("v-if",!0)],64))],8,["to","disabled"]))]),_:3},16))}});var eJ=Ne(QX,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tooltip-v2/src/tooltip.vue"]]);const tJ=it(eJ),z_="left-check-change",H_="right-check-change",Rl=Me({data:{type:se(Array),default:()=>[]},titles:{type:se(Array),default:()=>[]},buttonTexts:{type:se(Array),default:()=>[]},filterPlaceholder:String,filterMethod:{type:se(Function)},leftDefaultChecked:{type:se(Array),default:()=>[]},rightDefaultChecked:{type:se(Array),default:()=>[]},renderContent:{type:se(Function)},modelValue:{type:se(Array),default:()=>[]},format:{type:se(Object),default:()=>({})},filterable:Boolean,props:{type:se(Object),default:()=>Ft({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},validateEvent:{type:Boolean,default:!0}}),Bf=(e,t)=>[e,t].every(Ve)||Ve(e)&&nn(t),nJ={[At]:(e,t,n)=>[e,n].every(Ve)&&["left","right"].includes(t),[dt]:e=>Ve(e),[z_]:Bf,[H_]:Bf},Ff="checked-change",oJ=Me({data:Rl.data,optionRender:{type:se(Function)},placeholder:String,title:String,filterable:Boolean,format:Rl.format,filterMethod:Rl.filterMethod,defaultChecked:Rl.leftDefaultChecked,props:Rl.props}),rJ={[Ff]:Bf},oi=e=>{const t={label:"label",key:"key",disabled:"disabled"};return C(()=>({...t,...e.props}))},lJ=(e,t,n)=>{const o=oi(e),r=C(()=>e.data.filter(d=>Je(e.filterMethod)?e.filterMethod(t.query,d):String(d[o.value.label]||d[o.value.key]).toLowerCase().includes(t.query.toLowerCase()))),l=C(()=>r.value.filter(d=>!d[o.value.disabled])),s=C(()=>{const d=t.checked.length,f=e.data.length,{noChecked:p,hasChecked:v}=e.format;return p&&v?d>0?v.replace(/\${checked}/g,d.toString()).replace(/\${total}/g,f.toString()):p.replace(/\${total}/g,f.toString()):`${d}/${f}`}),a=C(()=>{const d=t.checked.length;return d>0&&d{const d=l.value.map(f=>f[o.value.key]);t.allChecked=d.length>0&&d.every(f=>t.checked.includes(f))},c=d=>{t.checked=d?l.value.map(f=>f[o.value.key]):[]};return me(()=>t.checked,(d,f)=>{if(u(),t.checkChangeByUser){const p=d.concat(f).filter(v=>!d.includes(v)||!f.includes(v));n(Ff,d,p)}else n(Ff,d),t.checkChangeByUser=!0}),me(l,()=>{u()}),me(()=>e.data,()=>{const d=[],f=r.value.map(p=>p[o.value.key]);t.checked.forEach(p=>{f.includes(p)&&d.push(p)}),t.checkChangeByUser=!1,t.checked=d}),me(()=>e.defaultChecked,(d,f)=>{if(f&&d.length===f.length&&d.every(m=>f.includes(m)))return;const p=[],v=l.value.map(m=>m[o.value.key]);d.forEach(m=>{v.includes(m)&&p.push(m)}),t.checkChangeByUser=!1,t.checked=p},{immediate:!0}),{filteredData:r,checkableData:l,checkedSummary:s,isIndeterminate:a,updateAllChecked:u,handleAllCheckedChange:c}},sJ=(e,t)=>({onSourceCheckedChange:(r,l)=>{e.leftChecked=r,l&&t(z_,r,l)},onTargetCheckedChange:(r,l)=>{e.rightChecked=r,l&&t(H_,r,l)}}),aJ=e=>{const t=oi(e),n=C(()=>e.data.reduce((l,s)=>(l[s[t.value.key]]=s)&&l,{})),o=C(()=>e.data.filter(l=>!e.modelValue.includes(l[t.value.key]))),r=C(()=>e.targetOrder==="original"?e.data.filter(l=>e.modelValue.includes(l[t.value.key])):e.modelValue.reduce((l,s)=>{const a=n.value[s];return a&&l.push(a),l},[]));return{sourceData:o,targetData:r}},iJ=(e,t,n)=>{const o=oi(e),r=(a,u,c)=>{n(dt,a),n(At,a,u,c)};return{addToLeft:()=>{const a=e.modelValue.slice();t.rightChecked.forEach(u=>{const c=a.indexOf(u);c>-1&&a.splice(c,1)}),r(a,"left",t.rightChecked)},addToRight:()=>{let a=e.modelValue.slice();const u=e.data.filter(c=>{const d=c[o.value.key];return t.leftChecked.includes(d)&&!e.modelValue.includes(d)}).map(c=>c[o.value.key]);a=e.targetOrder==="unshift"?u.concat(a):a.concat(u),e.targetOrder==="original"&&(a=e.data.filter(c=>a.includes(c[o.value.key])).map(c=>c[o.value.key])),r(a,"right",t.leftChecked)}}},uJ=G({name:"ElTransferPanel"}),cJ=G({...uJ,props:oJ,emits:rJ,setup(e,{expose:t,emit:n}){const o=e,r=cn(),l=({option:b})=>b,{t:s}=Ct(),a=ye("transfer"),u=yt({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),c=oi(o),{filteredData:d,checkedSummary:f,isIndeterminate:p,handleAllCheckedChange:v}=lJ(o,u,n),m=C(()=>!Yn(u.query)&&Yn(d.value)),h=C(()=>!Yn(r.default()[0].children)),{checked:g,allChecked:y,query:w}=Qt(u);return t({query:w}),(b,_)=>(S(),x("div",{class:E(i(a).b("panel"))},[I("p",{class:E(i(a).be("panel","header"))},[z(i(oo),{modelValue:i(y),"onUpdate:modelValue":_[0]||(_[0]=k=>It(y)?y.value=k:null),indeterminate:i(p),"validate-event":!1,onChange:i(v)},{default:q(()=>[nt(ue(b.title)+" ",1),I("span",null,ue(i(f)),1)]),_:1},8,["modelValue","indeterminate","onChange"])],2),I("div",{class:E([i(a).be("panel","body"),i(a).is("with-footer",i(h))])},[b.filterable?(S(),ae(i(mn),{key:0,modelValue:i(w),"onUpdate:modelValue":_[1]||(_[1]=k=>It(w)?w.value=k:null),class:E(i(a).be("panel","filter")),size:"default",placeholder:b.placeholder,"prefix-icon":i(_u),clearable:"","validate-event":!1},null,8,["modelValue","class","placeholder","prefix-icon"])):oe("v-if",!0),et(z(i(Yw),{modelValue:i(g),"onUpdate:modelValue":_[2]||(_[2]=k=>It(g)?g.value=k:null),"validate-event":!1,class:E([i(a).is("filterable",b.filterable),i(a).be("panel","list")])},{default:q(()=>[(S(!0),x(xe,null,lt(i(d),k=>(S(),ae(i(oo),{key:k[i(c).key],class:E(i(a).be("panel","item")),label:k[i(c).key],disabled:k[i(c).disabled],"validate-event":!1},{default:q(()=>{var $;return[z(l,{option:($=b.optionRender)==null?void 0:$.call(b,k)},null,8,["option"])]}),_:2},1032,["class","label","disabled"]))),128))]),_:1},8,["modelValue","class"]),[[kt,!i(m)&&!i(Yn)(b.data)]]),et(I("p",{class:E(i(a).be("panel","empty"))},ue(i(m)?i(s)("el.transfer.noMatch"):i(s)("el.transfer.noData")),3),[[kt,i(m)||i(Yn)(b.data)]])],2),i(h)?(S(),x("p",{key:0,class:E(i(a).be("panel","footer"))},[ve(b.$slots,"default")],2)):oe("v-if",!0)],2))}});var _y=Ne(cJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/transfer/src/transfer-panel.vue"]]);const dJ={key:0},fJ={key:0},pJ=G({name:"ElTransfer"}),hJ=G({...pJ,props:Rl,emits:nJ,setup(e,{expose:t,emit:n}){const o=e,r=cn(),{t:l}=Ct(),s=ye("transfer"),{formItem:a}=Tn(),u=yt({leftChecked:[],rightChecked:[]}),c=oi(o),{sourceData:d,targetData:f}=aJ(o),{onSourceCheckedChange:p,onTargetCheckedChange:v}=sJ(u,n),{addToLeft:m,addToRight:h}=iJ(o,u,n),g=N(),y=N(),w=O=>{switch(O){case"left":g.value.query="";break;case"right":y.value.query="";break}},b=C(()=>o.buttonTexts.length===2),_=C(()=>o.titles[0]||l("el.transfer.titles.0")),k=C(()=>o.titles[1]||l("el.transfer.titles.1")),$=C(()=>o.filterPlaceholder||l("el.transfer.filterPlaceholder"));me(()=>o.modelValue,()=>{var O;o.validateEvent&&((O=a==null?void 0:a.validate)==null||O.call(a,"change").catch(P=>void 0))});const M=C(()=>O=>o.renderContent?o.renderContent(je,O):r.default?r.default({option:O}):je("span",O[c.value.label]||O[c.value.key]));return t({clearQuery:w,leftPanel:g,rightPanel:y}),(O,P)=>(S(),x("div",{class:E(i(s).b())},[z(_y,{ref_key:"leftPanel",ref:g,data:i(d),"option-render":i(M),placeholder:i($),title:i(_),filterable:O.filterable,format:O.format,"filter-method":O.filterMethod,"default-checked":O.leftDefaultChecked,props:o.props,onCheckedChange:i(p)},{default:q(()=>[ve(O.$slots,"left-footer")]),_:3},8,["data","option-render","placeholder","title","filterable","format","filter-method","default-checked","props","onCheckedChange"]),I("div",{class:E(i(s).e("buttons"))},[z(i(Zt),{type:"primary",class:E([i(s).e("button"),i(s).is("with-texts",i(b))]),disabled:i(Yn)(u.rightChecked),onClick:i(m)},{default:q(()=>[z(i(ze),null,{default:q(()=>[z(i(Tr))]),_:1}),i(an)(O.buttonTexts[0])?oe("v-if",!0):(S(),x("span",dJ,ue(O.buttonTexts[0]),1))]),_:1},8,["class","disabled","onClick"]),z(i(Zt),{type:"primary",class:E([i(s).e("button"),i(s).is("with-texts",i(b))]),disabled:i(Yn)(u.leftChecked),onClick:i(h)},{default:q(()=>[i(an)(O.buttonTexts[1])?oe("v-if",!0):(S(),x("span",fJ,ue(O.buttonTexts[1]),1)),z(i(ze),null,{default:q(()=>[z(i(_n))]),_:1})]),_:1},8,["class","disabled","onClick"])],2),z(_y,{ref_key:"rightPanel",ref:y,data:i(f),"option-render":i(M),placeholder:i($),filterable:O.filterable,format:O.format,"filter-method":O.filterMethod,title:i(k),"default-checked":O.rightDefaultChecked,props:o.props,onCheckedChange:i(v)},{default:q(()=>[ve(O.$slots,"right-footer")]),_:3},8,["data","option-render","placeholder","filterable","format","filter-method","title","default-checked","props","onCheckedChange"])],2))}});var vJ=Ne(hJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/transfer/src/transfer.vue"]]);const mJ=it(vJ),Yl="$treeNodeId",Cy=function(e,t){!t||t[Yl]||Object.defineProperty(t,Yl,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},Yh=function(e,t){return e?t[e]:t[Yl]},Vf=(e,t,n)=>{const o=e.value.currentNode;n();const r=e.value.currentNode;o!==r&&t("current-change",r?r.data:null,r)},zf=e=>{let t=!0,n=!0,o=!0;for(let r=0,l=e.length;r"u"){const l=o[t];return l===void 0?"":l}};let gJ=0;class dl{constructor(t){this.id=gJ++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in t)gt(t,n)&&(this[n]=t[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const t=this.store;if(!t)throw new Error("[Node]store is required!");t.registerNode(this);const n=t.props;if(n&&typeof n.isLeaf<"u"){const l=Ii(this,"isLeaf");typeof l=="boolean"&&(this.isLeafByUser=l)}if(t.lazy!==!0&&this.data?(this.setData(this.data),t.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&t.lazy&&t.defaultExpandAll&&this.expand(),Array.isArray(this.data)||Cy(this,this.data),!this.data)return;const o=t.defaultExpandedKeys,r=t.key;r&&o&&o.includes(this.key)&&this.expand(null,t.autoExpandParent),r&&t.currentNodeKey!==void 0&&this.key===t.currentNodeKey&&(t.currentNode=this,t.currentNode.isCurrent=!0),t.lazy&&t._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(t){Array.isArray(t)||Cy(this,t),this.data=t,this.childNodes=[];let n;this.level===0&&Array.isArray(this.data)?n=this.data:n=Ii(this,"children")||[];for(let o=0,r=n.length;o-1)return t.childNodes[n+1]}return null}get previousSibling(){const t=this.parent;if(t){const n=t.childNodes.indexOf(this);if(n>-1)return n>0?t.childNodes[n-1]:null}return null}contains(t,n=!0){return(this.childNodes||[]).some(o=>o===t||n&&o.contains(t))}remove(){const t=this.parent;t&&t.removeChild(this)}insertChild(t,n,o){if(!t)throw new Error("InsertChild error: child is required.");if(!(t instanceof dl)){if(!o){const r=this.getChildren(!0);r.includes(t.data)||(typeof n>"u"||n<0?r.push(t.data):r.splice(n,0,t.data))}Object.assign(t,{parent:this,store:this.store}),t=yt(new dl(t)),t instanceof dl&&t.initialize()}t.level=this.level+1,typeof n>"u"||n<0?this.childNodes.push(t):this.childNodes.splice(n,0,t),this.updateLeafState()}insertBefore(t,n){let o;n&&(o=this.childNodes.indexOf(n)),this.insertChild(t,o)}insertAfter(t,n){let o;n&&(o=this.childNodes.indexOf(n),o!==-1&&(o+=1)),this.insertChild(t,o)}removeChild(t){const n=this.getChildren()||[],o=n.indexOf(t.data);o>-1&&n.splice(o,1);const r=this.childNodes.indexOf(t);r>-1&&(this.store&&this.store.deregisterNode(t),t.parent=null,this.childNodes.splice(r,1)),this.updateLeafState()}removeChildByData(t){let n=null;for(let o=0;o{if(n){let r=this.parent;for(;r.level>0;)r.expanded=!0,r=r.parent}this.expanded=!0,t&&t(),this.childNodes.forEach(r=>{r.canFocus=!0})};this.shouldLoadData()?this.loadData(r=>{Array.isArray(r)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||ru(this),o())}):o()}doCreateChildren(t,n={}){t.forEach(o=>{this.insertChild(Object.assign({data:o},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(t=>{t.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const t=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!t||t.length===0;return}this.isLeaf=!1}setChecked(t,n,o,r){if(this.indeterminate=t==="half",this.checked=t===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:a}=zf(this.childNodes);!this.isLeaf&&!s&&a&&(this.checked=!1,t=!1);const u=()=>{if(n){const c=this.childNodes;for(let p=0,v=c.length;p{u(),ru(this)},{checked:t!==!1});return}else u()}const l=this.parent;!l||l.level===0||o||ru(l)}getChildren(t=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const o=this.store.props;let r="children";return o&&(r=o.children||"children"),n[r]===void 0&&(n[r]=null),t&&!n[r]&&(n[r]=[]),n[r]}updateChildren(){const t=this.getChildren()||[],n=this.childNodes.map(l=>l.data),o={},r=[];t.forEach((l,s)=>{const a=l[Yl];!!a&&n.findIndex(c=>c[Yl]===a)>=0?o[a]={index:s,data:l}:r.push({index:s,data:l})}),this.store.lazy||n.forEach(l=>{o[l[Yl]]||this.removeChildByData(l)}),r.forEach(({index:l,data:s})=>{this.insertChild({data:s},l)}),this.updateLeafState()}loadData(t,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const o=r=>{this.childNodes=[],this.doCreateChildren(r,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),t&&t.call(this,r)};this.store.load(this,o)}else t&&t.call(this)}}class yJ{constructor(t){this.currentNode=null,this.currentNodeKey=null;for(const n in t)gt(t,n)&&(this[n]=t[n]);this.nodesMap={}}initialize(){if(this.root=new dl({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const t=this.load;t(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(t){const n=this.filterNodeMethod,o=this.lazy,r=function(l){const s=l.root?l.root.childNodes:l.childNodes;if(s.forEach(a=>{a.visible=n.call(a,t,a.data,a),r(a)}),!l.visible&&s.length){let a=!0;a=!s.some(u=>u.visible),l.root?l.root.visible=a===!1:l.visible=a===!1}t&&l.visible&&!l.isLeaf&&!o&&l.expand()};r(this)}setData(t){t!==this.root.data?(this.root.setData(t),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(t){if(t instanceof dl)return t;const n=ft(t)?Yh(this.key,t):t;return this.nodesMap[n]||null}insertBefore(t,n){const o=this.getNode(n);o.parent.insertBefore({data:t},o)}insertAfter(t,n){const o=this.getNode(n);o.parent.insertAfter({data:t},o)}remove(t){const n=this.getNode(t);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(t,n){const o=n?this.getNode(n):this.root;o&&o.insertChild({data:t})}_initDefaultCheckedNodes(){const t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach(o=>{const r=n[o];r&&r.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(t){(this.defaultCheckedKeys||[]).includes(t.key)&&t.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(t){t!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=t,this._initDefaultCheckedNodes())}registerNode(t){const n=this.key;!t||!t.data||(n?t.key!==void 0&&(this.nodesMap[t.key]=t):this.nodesMap[t.id]=t)}deregisterNode(t){!this.key||!t||!t.data||(t.childNodes.forEach(o=>{this.deregisterNode(o)}),delete this.nodesMap[t.key])}getCheckedNodes(t=!1,n=!1){const o=[],r=function(l){(l.root?l.root.childNodes:l.childNodes).forEach(a=>{(a.checked||n&&a.indeterminate)&&(!t||t&&a.isLeaf)&&o.push(a.data),r(a)})};return r(this),o}getCheckedKeys(t=!1){return this.getCheckedNodes(t).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const t=[],n=function(o){(o.root?o.root.childNodes:o.childNodes).forEach(l=>{l.indeterminate&&t.push(l.data),n(l)})};return n(this),t}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(t=>(t||{})[this.key])}_getAllNodes(){const t=[],n=this.nodesMap;for(const o in n)gt(n,o)&&t.push(n[o]);return t}updateChildren(t,n){const o=this.nodesMap[t];if(!o)return;const r=o.childNodes;for(let l=r.length-1;l>=0;l--){const s=r[l];this.remove(s.data)}for(let l=0,s=n.length;lu.level-a.level),l=Object.create(null),s=Object.keys(o);r.forEach(a=>a.setChecked(!1,!1));for(let a=0,u=r.length;a0;)l[p.data[t]]=!0,p=p.parent;if(c.isLeaf||this.checkStrictly){c.setChecked(!0,!1);continue}if(c.setChecked(!0,!0),n){c.setChecked(!1,!1);const v=function(m){m.childNodes.forEach(g=>{g.isLeaf||g.setChecked(!1,!1),v(g)})};v(c)}}}setCheckedNodes(t,n=!1){const o=this.key,r={};t.forEach(l=>{r[(l||{})[o]]=!0}),this._setCheckedKeys(o,n,r)}setCheckedKeys(t,n=!1){this.defaultCheckedKeys=t;const o=this.key,r={};t.forEach(l=>{r[l]=!0}),this._setCheckedKeys(o,n,r)}setDefaultExpandedKeys(t){t=t||[],this.defaultExpandedKeys=t,t.forEach(n=>{const o=this.getNode(n);o&&o.expand(null,this.autoExpandParent)})}setChecked(t,n,o){const r=this.getNode(t);r&&r.setChecked(!!n,o)}getCurrentNode(){return this.currentNode}setCurrentNode(t){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=t,this.currentNode.isCurrent=!0}setUserCurrentNode(t,n=!0){const o=t[this.key],r=this.nodesMap[o];this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(t,n=!0){if(t==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const o=this.getNode(t);o&&(this.setCurrentNode(o),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const bJ=G({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=ye("tree"),n=De("NodeInstance"),o=De("RootTree");return()=>{const r=e.node,{data:l,store:s}=r;return e.renderContent?e.renderContent(je,{_self:n,node:r,data:l,store:s}):o.ctx.slots.default?o.ctx.slots.default({node:r,data:l}):je("span",{class:t.be("node","label")},[r.label])}}});var wJ=Ne(bJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node-content.vue"]]);function K_(e){const t=De("TreeNodeMap",null),n={treeNodeExpand:o=>{e.node!==o&&e.node.collapse()},children:[]};return t&&t.children.push(n),ht("TreeNodeMap",n),{broadcastExpanded:o=>{if(e.accordion)for(const r of n.children)r.treeNodeExpand(o)}}}const j_=Symbol("dragEvents");function _J({props:e,ctx:t,el$:n,dropIndicator$:o,store:r}){const l=ye("tree"),s=N({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null});return ht(j_,{treeNodeDragStart:({event:d,treeNode:f})=>{if(typeof e.allowDrag=="function"&&!e.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=f,t.emit("node-drag-start",f.node,d)},treeNodeDragOver:({event:d,treeNode:f})=>{const p=f,v=s.value.dropNode;v&&v!==p&&In(v.$el,l.is("drop-inner"));const m=s.value.draggingNode;if(!m||!p)return;let h=!0,g=!0,y=!0,w=!0;typeof e.allowDrop=="function"&&(h=e.allowDrop(m.node,p.node,"prev"),w=g=e.allowDrop(m.node,p.node,"inner"),y=e.allowDrop(m.node,p.node,"next")),d.dataTransfer.dropEffect=g||h||y?"move":"none",(h||g||y)&&v!==p&&(v&&t.emit("node-drag-leave",m.node,v.node,d),t.emit("node-drag-enter",m.node,p.node,d)),(h||g||y)&&(s.value.dropNode=p),p.node.nextSibling===m.node&&(y=!1),p.node.previousSibling===m.node&&(h=!1),p.node.contains(m.node,!1)&&(g=!1),(m.node===p.node||m.node.contains(p.node))&&(h=!1,g=!1,y=!1);const b=p.$el.getBoundingClientRect(),_=n.value.getBoundingClientRect();let k;const $=h?g?.25:y?.45:1:-1,M=y?g?.75:h?.55:0:1;let O=-9999;const P=d.clientY-b.top;Pb.height*M?k="after":g?k="inner":k="none";const A=p.$el.querySelector(`.${l.be("node","expand-icon")}`).getBoundingClientRect(),V=o.value;k==="before"?O=A.top-_.top:k==="after"&&(O=A.bottom-_.top),V.style.top=`${O}px`,V.style.left=`${A.right-_.left}px`,k==="inner"?To(p.$el,l.is("drop-inner")):In(p.$el,l.is("drop-inner")),s.value.showDropIndicator=k==="before"||k==="after",s.value.allowDrop=s.value.showDropIndicator||w,s.value.dropType=k,t.emit("node-drag-over",m.node,p.node,d)},treeNodeDragEnd:d=>{const{draggingNode:f,dropType:p,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer.dropEffect="move",f&&v){const m={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?v.node.parent.insertBefore(m,v.node):p==="after"?v.node.parent.insertAfter(m,v.node):p==="inner"&&v.node.insertChild(m),p!=="none"&&r.value.registerNode(m),In(v.$el,l.is("drop-inner")),t.emit("node-drag-end",f.node,v.node,p,d),p!=="none"&&t.emit("node-drop",f.node,v.node,p,d)}f&&!v&&t.emit("node-drag-end",f.node,null,p,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0}}),{dragState:s}}const CJ=G({name:"ElTreeNode",components:{ElCollapseTransition:_c,ElCheckbox:oo,NodeContent:wJ,ElIcon:ze,Loading:Dr},props:{node:{type:dl,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const n=ye("tree"),{broadcastExpanded:o}=K_(e),r=De("RootTree"),l=N(!1),s=N(!1),a=N(null),u=N(null),c=N(null),d=De(j_),f=ut();ht("NodeInstance",f),e.node.expanded&&(l.value=!0,s.value=!0);const p=r.props.children||"children";me(()=>{const P=e.node.data[p];return P&&[...P]},()=>{e.node.updateChildren()}),me(()=>e.node.indeterminate,P=>{h(e.node.checked,P)}),me(()=>e.node.checked,P=>{h(P,e.node.indeterminate)}),me(()=>e.node.expanded,P=>{Ke(()=>l.value=P),P&&(s.value=!0)});const v=P=>Yh(r.props.nodeKey,P.data),m=P=>{const A=e.props.class;if(!A)return{};let V;if(Je(A)){const{data:B}=P;V=A(B,P)}else V=A;return Ze(V)?{[V]:!0}:V},h=(P,A)=>{(a.value!==P||u.value!==A)&&r.ctx.emit("check-change",e.node.data,P,A),a.value=P,u.value=A},g=P=>{Vf(r.store,r.ctx.emit,()=>r.store.value.setCurrentNode(e.node)),r.currentNode.value=e.node,r.props.expandOnClickNode&&w(),r.props.checkOnClickNode&&!e.node.disabled&&b(null,{target:{checked:!e.node.checked}}),r.ctx.emit("node-click",e.node.data,e.node,f,P)},y=P=>{r.instance.vnode.props.onNodeContextmenu&&(P.stopPropagation(),P.preventDefault()),r.ctx.emit("node-contextmenu",P,e.node.data,e.node,f)},w=()=>{e.node.isLeaf||(l.value?(r.ctx.emit("node-collapse",e.node.data,e.node,f),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,f)))},b=(P,A)=>{e.node.setChecked(A.target.checked,!r.props.checkStrictly),Ke(()=>{const V=r.store.value;r.ctx.emit("check",e.node.data,{checkedNodes:V.getCheckedNodes(),checkedKeys:V.getCheckedKeys(),halfCheckedNodes:V.getHalfCheckedNodes(),halfCheckedKeys:V.getHalfCheckedKeys()})})};return{ns:n,node$:c,tree:r,expanded:l,childNodeRendered:s,oldChecked:a,oldIndeterminate:u,getNodeKey:v,getNodeClass:m,handleSelectChange:h,handleClick:g,handleContextMenu:y,handleExpandIconClick:w,handleCheckChange:b,handleChildNodeExpand:(P,A,V)=>{o(A),r.ctx.emit("node-expand",P,A,V)},handleDragStart:P=>{r.props.draggable&&d.treeNodeDragStart({event:P,treeNode:e})},handleDragOver:P=>{P.preventDefault(),r.props.draggable&&d.treeNodeDragOver({event:P,treeNode:{$el:c.value,node:e.node}})},handleDrop:P=>{P.preventDefault()},handleDragEnd:P=>{r.props.draggable&&d.treeNodeDragEnd(P)},CaretRight:sc}}}),SJ=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],kJ=["aria-expanded"];function $J(e,t,n,o,r,l){const s=Qe("el-icon"),a=Qe("el-checkbox"),u=Qe("loading"),c=Qe("node-content"),d=Qe("el-tree-node"),f=Qe("el-collapse-transition");return et((S(),x("div",{ref:"node$",class:E([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=Ge((...p)=>e.handleClick&&e.handleClick(...p),["stop"])),onContextmenu:t[2]||(t[2]=(...p)=>e.handleContextMenu&&e.handleContextMenu(...p)),onDragstart:t[3]||(t[3]=Ge((...p)=>e.handleDragStart&&e.handleDragStart(...p),["stop"])),onDragover:t[4]||(t[4]=Ge((...p)=>e.handleDragOver&&e.handleDragOver(...p),["stop"])),onDragend:t[5]||(t[5]=Ge((...p)=>e.handleDragEnd&&e.handleDragEnd(...p),["stop"])),onDrop:t[6]||(t[6]=Ge((...p)=>e.handleDrop&&e.handleDrop(...p),["stop"]))},[I("div",{class:E(e.ns.be("node","content")),style:He({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?(S(),ae(s,{key:0,class:E([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:Ge(e.handleExpandIconClick,["stop"])},{default:q(()=>[(S(),ae(vt(e.tree.props.icon||e.CaretRight)))]),_:1},8,["class","onClick"])):oe("v-if",!0),e.showCheckbox?(S(),ae(a,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=Ge(()=>{},["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):oe("v-if",!0),e.node.loading?(S(),ae(s,{key:2,class:E([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:q(()=>[z(u)]),_:1},8,["class"])):oe("v-if",!0),z(c,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),z(f,null,{default:q(()=>[!e.renderAfterExpand||e.childNodeRendered?et((S(),x("div",{key:0,class:E(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[(S(!0),x(xe,null,lt(e.node.childNodes,p=>(S(),ae(d,{key:e.getNodeKey(p),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:p,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,kJ)),[[kt,e.expanded]]):oe("v-if",!0)]),_:1})],42,SJ)),[[kt,e.node.visible]])}var EJ=Ne(CJ,[["render",$J],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree-node.vue"]]);function TJ({el$:e},t){const n=ye("tree"),o=Pt([]),r=Pt([]);tt(()=>{s()}),er(()=>{o.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),r.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))}),me(r,a=>{a.forEach(u=>{u.setAttribute("tabindex","-1")})}),Vt(e,"keydown",a=>{const u=a.target;if(!u.className.includes(n.b("node")))return;const c=a.code;o.value=Array.from(e.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`));const d=o.value.indexOf(u);let f;if([We.up,We.down].includes(c)){if(a.preventDefault(),c===We.up){f=d===-1?0:d!==0?d-1:o.value.length-1;const v=f;for(;!t.value.getNode(o.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=o.value.length-1)}}else{f=d===-1?0:d=o.value.length&&(f=0)}}f!==-1&&o.value[f].focus()}[We.left,We.right].includes(c)&&(a.preventDefault(),u.click());const p=u.querySelector('[type="checkbox"]');[We.enter,We.space].includes(c)&&p&&(a.preventDefault(),p.click())});const s=()=>{var a;o.value=Array.from(e.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)),r.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const u=e.value.querySelectorAll(`.${n.is("checked")}[role=treeitem]`);if(u.length){u[0].setAttribute("tabindex","0");return}(a=o.value[0])==null||a.setAttribute("tabindex","0")}}const OJ=G({name:"ElTree",components:{ElTreeNode:EJ},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Rt}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:n}=Ct(),o=ye("tree"),r=N(new yJ({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));r.value.initialize();const l=N(r.value.root),s=N(null),a=N(null),u=N(null),{broadcastExpanded:c}=K_(e),{dragState:d}=_J({props:e,ctx:t,el$:a,dropIndicator$:u,store:r});TJ({el$:a},r);const f=C(()=>{const{childNodes:T}=l.value;return!T||T.length===0||T.every(({visible:L})=>!L)});me(()=>e.currentNodeKey,T=>{r.value.setCurrentNodeKey(T)}),me(()=>e.defaultCheckedKeys,T=>{r.value.setDefaultCheckedKey(T)}),me(()=>e.defaultExpandedKeys,T=>{r.value.setDefaultExpandedKeys(T)}),me(()=>e.data,T=>{r.value.setData(T)},{deep:!0}),me(()=>e.checkStrictly,T=>{r.value.checkStrictly=T});const p=T=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");r.value.filter(T)},v=T=>Yh(e.nodeKey,T.data),m=T=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const L=r.value.getNode(T);if(!L)return[];const R=[L.data];let U=L.parent;for(;U&&U!==l.value;)R.push(U.data),U=U.parent;return R.reverse()},h=(T,L)=>r.value.getCheckedNodes(T,L),g=T=>r.value.getCheckedKeys(T),y=()=>{const T=r.value.getCurrentNode();return T?T.data:null},w=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const T=y();return T?T[e.nodeKey]:null},b=(T,L)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");r.value.setCheckedNodes(T,L)},_=(T,L)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");r.value.setCheckedKeys(T,L)},k=(T,L,R)=>{r.value.setChecked(T,L,R)},$=()=>r.value.getHalfCheckedNodes(),M=()=>r.value.getHalfCheckedKeys(),O=(T,L=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Vf(r,t.emit,()=>r.value.setUserCurrentNode(T,L))},P=(T,L=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Vf(r,t.emit,()=>r.value.setCurrentNodeKey(T,L))},A=T=>r.value.getNode(T),V=T=>{r.value.remove(T)},B=(T,L)=>{r.value.append(T,L)},D=(T,L)=>{r.value.insertBefore(T,L)},H=(T,L)=>{r.value.insertAfter(T,L)},W=(T,L,R)=>{c(L),t.emit("node-expand",T,L,R)},F=(T,L)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");r.value.updateChildren(T,L)};return ht("RootTree",{ctx:t,props:e,store:r,root:l,currentNode:s,instance:ut()}),ht(xo,void 0),{ns:o,store:r,root:l,currentNode:s,dragState:d,el$:a,dropIndicator$:u,isEmpty:f,filter:p,getNodeKey:v,getNodePath:m,getCheckedNodes:h,getCheckedKeys:g,getCurrentNode:y,getCurrentKey:w,setCheckedNodes:b,setCheckedKeys:_,setChecked:k,getHalfCheckedNodes:$,getHalfCheckedKeys:M,setCurrentNode:O,setCurrentKey:P,t:n,getNode:A,remove:V,append:B,insertBefore:D,insertAfter:H,handleNodeExpand:W,updateKeyChildren:F}}});function NJ(e,t,n,o,r,l){var s;const a=Qe("el-tree-node");return S(),x("div",{ref:"el$",class:E([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner",e.dragState.dropType==="inner"),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[(S(!0),x(xe,null,lt(e.root.childNodes,u=>(S(),ae(a,{key:e.getNodeKey(u),node:u,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),e.isEmpty?(S(),x("div",{key:0,class:E(e.ns.e("empty-block"))},[I("span",{class:E(e.ns.e("empty-text"))},ue((s=e.emptyText)!=null?s:e.t("el.tree.emptyText")),3)],2)):oe("v-if",!0),et(I("div",{ref:"dropIndicator$",class:E(e.ns.e("drop-indicator"))},null,2),[[kt,e.dragState.showDropIndicator]])],2)}var lu=Ne(OJ,[["render",NJ],["__file","/home/runner/work/element-plus/element-plus/packages/components/tree/src/tree.vue"]]);lu.install=e=>{e.component(lu.name,lu)};const Lu=lu,MJ=Lu,IJ=(e,{attrs:t},{tree:n,key:o})=>{const r=ye("tree-select"),l={...Uo(Qt(e),Object.keys(vl.props)),...t,valueKey:o,popperClass:C(()=>{const s=[r.e("popper")];return e.popperClass&&s.push(e.popperClass),s.join(" ")}),filterMethod:(s="")=>{e.filterMethod&&e.filterMethod(s),Ke(()=>{var a;(a=n.value)==null||a.filter(s)})},onVisibleChange:s=>{var a;(a=t.onVisibleChange)==null||a.call(t,s),e.filterable&&s&&l.filterMethod()}};return l},PJ=G({extends:Ou,setup(e,t){const n=Ou.setup(e,t);delete n.selectOptionClick;const o=ut().proxy;return Ke(()=>{n.select.cachedOptions.get(o.value)||n.select.onOptionCreate(o)}),n},methods:{selectOptionClick(){this.$el.parentElement.click()}}});function Hf(e){return e||e===0}function Gh(e){return Array.isArray(e)&&e.length}function dd(e){return Array.isArray(e)?e:Hf(e)?[e]:[]}function su(e,t,n,o,r){for(let l=0;l{me(()=>e.modelValue,()=>{e.showCheckbox&&Ke(()=>{const f=l.value;f&&!jn(f.getCheckedKeys(),dd(e.modelValue))&&f.setCheckedKeys(dd(e.modelValue))})},{immediate:!0,deep:!0});const a=C(()=>({value:s.value,label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",...e.props})),u=(f,p)=>{var v;const m=a.value[f];return Je(m)?m(p,(v=l.value)==null?void 0:v.getNode(u("value",p))):p[m]},c=dd(e.modelValue).map(f=>su(e.data||[],p=>u("value",p)===f,p=>u("children",p),(p,v,m,h)=>h&&u("value",h))).filter(f=>Hf(f)),d=C(()=>{if(!e.renderAfterExpand&&!e.lazy)return[];const f=[];return W_(e.data.concat(e.cacheData),p=>{const v=u("value",p);f.push({value:v,currentLabel:u("label",p),isDisabled:u("disabled",p)})},p=>u("children",p)),f});return{...Uo(Qt(e),Object.keys(Lu.props)),...t,nodeKey:s,expandOnClickNode:C(()=>!e.checkStrictly&&e.expandOnClickNode),defaultExpandedKeys:C(()=>e.defaultExpandedKeys?e.defaultExpandedKeys.concat(c):c),renderContent:(f,{node:p,data:v,store:m})=>f(PJ,{value:u("value",v),label:u("label",v),disabled:u("disabled",v)},e.renderContent?()=>e.renderContent(f,{node:p,data:v,store:m}):n.default?()=>n.default({node:p,data:v,store:m}):void 0),filterNodeMethod:(f,p,v)=>{var m;return e.filterNodeMethod?e.filterNodeMethod(f,p,v):f?(m=u("label",p))==null?void 0:m.includes(f):!0},onNodeClick:(f,p,v)=>{var m,h,g;if((m=t.onNodeClick)==null||m.call(t,f,p,v),!(e.showCheckbox&&e.checkOnClickNode))if(!e.showCheckbox&&(e.checkStrictly||p.isLeaf)){if(!u("disabled",f)){const y=(h=r.value)==null?void 0:h.options.get(u("value",f));(g=r.value)==null||g.handleOptionSelect(y,!0)}}else e.expandOnClickNode&&v.proxy.handleExpandIconClick()},onCheck:(f,p)=>{var v;(v=t.onCheck)==null||v.call(t,f,p);const m=u("value",f);if(e.checkStrictly)o(dt,e.multiple?p.checkedKeys:p.checkedKeys.includes(m)?m:void 0);else if(e.multiple)o(dt,l.value.getCheckedKeys(!0));else{const h=su([f],w=>!Gh(u("children",w))&&!u("disabled",w),w=>u("children",w)),g=h?u("value",h):void 0,y=Hf(e.modelValue)&&!!su([f],w=>u("value",w)===e.modelValue,w=>u("children",w));o(dt,g===e.modelValue||y?void 0:g)}},cacheOptions:d}};var AJ=G({props:{data:{type:Array,default:()=>[]}},setup(e){const t=De(ti);return me(()=>e.data,()=>{var n;e.data.forEach(r=>{t.cachedOptions.has(r.value)||t.cachedOptions.set(r.value,r)});const o=((n=t.selectWrapper)==null?void 0:n.querySelectorAll("input"))||[];Array.from(o).includes(document.activeElement)||t.setSelected()},{flush:"post",immediate:!0}),()=>{}}});const xJ=G({name:"ElTreeSelect",inheritAttrs:!1,props:{...vl.props,...Lu.props,cacheData:{type:Array,default:()=>[]}},setup(e,t){const{slots:n,expose:o}=t,r=N(),l=N(),s=C(()=>e.nodeKey||e.valueKey||"value"),a=IJ(e,t,{select:r,tree:l,key:s}),{cacheOptions:u,...c}=RJ(e,t,{select:r,tree:l,key:s}),d=yt({});return o(d),tt(()=>{Object.assign(d,{...Uo(l.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...Uo(r.value,["focus","blur"])})}),()=>je(vl,yt({...a,ref:f=>r.value=f}),{...n,default:()=>[je(AJ,{data:u.value}),je(Lu,yt({...c,ref:f=>l.value=f}))]})}});var au=Ne(xJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-select/src/tree-select.vue"]]);au.install=e=>{e.component(au.name,au)};const LJ=au,DJ=LJ,Xh=Symbol(),BJ={key:-1,level:-1,data:{}};var Vs=(e=>(e.KEY="id",e.LABEL="label",e.CHILDREN="children",e.DISABLED="disabled",e))(Vs||{}),Kf=(e=>(e.ADD="add",e.DELETE="delete",e))(Kf||{});const U_={type:Number,default:26},FJ=Me({data:{type:se(Array),default:()=>Ft([])},emptyText:{type:String},height:{type:Number,default:200},props:{type:se(Object),default:()=>Ft({children:"children",label:"label",disabled:"disabled",value:"id"})},highlightCurrent:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},defaultCheckedKeys:{type:se(Array),default:()=>Ft([])},checkStrictly:{type:Boolean,default:!1},defaultExpandedKeys:{type:se(Array),default:()=>Ft([])},indent:{type:Number,default:16},itemSize:U_,icon:{type:Rt},expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!1},currentNodeKey:{type:se([String,Number])},accordion:{type:Boolean,default:!1},filterMethod:{type:se(Function)},perfMode:{type:Boolean,default:!0}}),VJ=Me({node:{type:se(Object),default:()=>Ft(BJ)},expanded:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},current:{type:Boolean,default:!1},hiddenExpandIcon:{type:Boolean,default:!1},itemSize:U_}),zJ=Me({node:{type:se(Object),required:!0}}),q_="node-click",Y_="node-expand",G_="node-collapse",X_="current-change",J_="check",Z_="check-change",Q_="node-contextmenu",HJ={[q_]:(e,t,n)=>e&&t&&n,[Y_]:(e,t)=>e&&t,[G_]:(e,t)=>e&&t,[X_]:(e,t)=>e&&t,[J_]:(e,t)=>e&&t,[Z_]:(e,t)=>e&&typeof t=="boolean",[Q_]:(e,t,n)=>e&&t&&n},KJ={click:(e,t)=>!!(e&&t),toggle:e=>!!e,check:(e,t)=>e&&typeof t=="boolean"};function jJ(e,t){const n=N(new Set),o=N(new Set),{emit:r}=ut();me([()=>t.value,()=>e.defaultCheckedKeys],()=>Ke(()=>{w(e.defaultCheckedKeys)}),{immediate:!0});const l=()=>{if(!t.value||!e.showCheckbox||e.checkStrictly)return;const{levelTreeNodeMap:b,maxLevel:_}=t.value,k=n.value,$=new Set;for(let M=_-1;M>=1;--M){const O=b.get(M);O&&O.forEach(P=>{const A=P.children;if(A){let V=!0,B=!1;for(const D of A){const H=D.key;if(k.has(H))B=!0;else if($.has(H)){V=!1,B=!0;break}else V=!1}V?k.add(P.key):B?($.add(P.key),k.delete(P.key)):(k.delete(P.key),$.delete(P.key))}})}o.value=$},s=b=>n.value.has(b.key),a=b=>o.value.has(b.key),u=(b,_,k=!0)=>{const $=n.value,M=(O,P)=>{$[P?Kf.ADD:Kf.DELETE](O.key);const A=O.children;!e.checkStrictly&&A&&A.forEach(V=>{V.disabled||M(V,P)})};M(b,_),l(),k&&c(b,_)},c=(b,_)=>{const{checkedNodes:k,checkedKeys:$}=m(),{halfCheckedNodes:M,halfCheckedKeys:O}=h();r(J_,b.data,{checkedKeys:$,checkedNodes:k,halfCheckedKeys:O,halfCheckedNodes:M}),r(Z_,b.data,_)};function d(b=!1){return m(b).checkedKeys}function f(b=!1){return m(b).checkedNodes}function p(){return h().halfCheckedKeys}function v(){return h().halfCheckedNodes}function m(b=!1){const _=[],k=[];if(t!=null&&t.value&&e.showCheckbox){const{treeNodeMap:$}=t.value;n.value.forEach(M=>{const O=$.get(M);O&&(!b||b&&O.isLeaf)&&(k.push(M),_.push(O.data))})}return{checkedKeys:k,checkedNodes:_}}function h(){const b=[],_=[];if(t!=null&&t.value&&e.showCheckbox){const{treeNodeMap:k}=t.value;o.value.forEach($=>{const M=k.get($);M&&(_.push($),b.push(M.data))})}return{halfCheckedNodes:b,halfCheckedKeys:_}}function g(b){n.value.clear(),o.value.clear(),w(b)}function y(b,_){if(t!=null&&t.value&&e.showCheckbox){const k=t.value.treeNodeMap.get(b);k&&u(k,_,!1)}}function w(b){if(t!=null&&t.value){const{treeNodeMap:_}=t.value;if(e.showCheckbox&&_&&b)for(const k of b){const $=_.get(k);$&&!s($)&&u($,!0,!1)}}}return{updateCheckedKeys:l,toggleCheckbox:u,isChecked:s,isIndeterminate:a,getCheckedKeys:d,getCheckedNodes:f,getHalfCheckedKeys:p,getHalfCheckedNodes:v,setChecked:y,setCheckedKeys:g}}function WJ(e,t){const n=N(new Set([])),o=N(new Set([])),r=C(()=>Je(e.filterMethod));function l(a){var u;if(!r.value)return;const c=new Set,d=o.value,f=n.value,p=[],v=((u=t.value)==null?void 0:u.treeNodes)||[],m=e.filterMethod;f.clear();function h(g){g.forEach(y=>{p.push(y),m!=null&&m(a,y.data)?p.forEach(b=>{c.add(b.key)}):y.isLeaf&&f.add(y.key);const w=y.children;if(w&&h(w),!y.isLeaf){if(!c.has(y.key))f.add(y.key);else if(w){let b=!0;for(const _ of w)if(!f.has(_.key)){b=!1;break}b?d.add(y.key):d.delete(y.key)}}p.pop()})}return h(v),c}function s(a){return o.value.has(a.key)}return{hiddenExpandIconKeySet:o,hiddenNodeKeySet:n,doFilter:l,isForceHiddenExpandIcon:s}}function UJ(e,t){const n=N(new Set(e.defaultExpandedKeys)),o=N(),r=Pt();me(()=>e.currentNodeKey,X=>{o.value=X},{immediate:!0}),me(()=>e.data,X=>{Z(X)},{immediate:!0});const{isIndeterminate:l,isChecked:s,toggleCheckbox:a,getCheckedKeys:u,getCheckedNodes:c,getHalfCheckedKeys:d,getHalfCheckedNodes:f,setChecked:p,setCheckedKeys:v}=jJ(e,r),{doFilter:m,hiddenNodeKeySet:h,isForceHiddenExpandIcon:g}=WJ(e,r),y=C(()=>{var X;return((X=e.props)==null?void 0:X.value)||Vs.KEY}),w=C(()=>{var X;return((X=e.props)==null?void 0:X.children)||Vs.CHILDREN}),b=C(()=>{var X;return((X=e.props)==null?void 0:X.disabled)||Vs.DISABLED}),_=C(()=>{var X;return((X=e.props)==null?void 0:X.label)||Vs.LABEL}),k=C(()=>{const X=n.value,le=h.value,de=[],Ie=r.value&&r.value.treeNodes||[];function K(){const J=[];for(let fe=Ie.length-1;fe>=0;--fe)J.push(Ie[fe]);for(;J.length;){const fe=J.pop();if(fe&&(le.has(fe.key)||de.push(fe),X.has(fe.key))){const ge=fe.children;if(ge){const Oe=ge.length;for(let ce=Oe-1;ce>=0;--ce)J.push(ge[ce])}}}}return K(),de}),$=C(()=>k.value.length>0);function M(X){const le=new Map,de=new Map;let Ie=1;function K(fe,ge=1,Oe=void 0){var ce;const Te=[];for(const be of fe){const Ee=A(be),_e={level:ge,key:Ee,data:be};_e.label=B(be),_e.parent=Oe;const Le=P(be);_e.disabled=V(be),_e.isLeaf=!Le||Le.length===0,Le&&Le.length&&(_e.children=K(Le,ge+1,_e)),Te.push(_e),le.set(Ee,_e),de.has(ge)||de.set(ge,[]),(ce=de.get(ge))==null||ce.push(_e)}return ge>Ie&&(Ie=ge),Te}const J=K(X);return{treeNodeMap:le,levelTreeNodeMap:de,maxLevel:Ie,treeNodes:J}}function O(X){const le=m(X);le&&(n.value=le)}function P(X){return X[w.value]}function A(X){return X?X[y.value]:""}function V(X){return X[b.value]}function B(X){return X[_.value]}function D(X){n.value.has(X.key)?R(X):L(X)}function H(X){n.value=new Set(X)}function W(X,le){t(q_,X.data,X,le),F(X),e.expandOnClickNode&&D(X),e.showCheckbox&&e.checkOnClickNode&&!X.disabled&&a(X,!s(X),!0)}function F(X){j(X)||(o.value=X.key,t(X_,X.data,X))}function T(X,le){a(X,le)}function L(X){const le=n.value;if(r.value&&e.accordion){const{treeNodeMap:de}=r.value;le.forEach(Ie=>{const K=de.get(Ie);X&&X.level===(K==null?void 0:K.level)&&le.delete(Ie)})}le.add(X.key),t(Y_,X.data,X)}function R(X){n.value.delete(X.key),t(G_,X.data,X)}function U(X){return n.value.has(X.key)}function ne(X){return!!X.disabled}function j(X){const le=o.value;return!!le&&le===X.key}function Q(){var X,le;if(o.value)return(le=(X=r.value)==null?void 0:X.treeNodeMap.get(o.value))==null?void 0:le.data}function he(){return o.value}function ee(X){o.value=X}function Z(X){Ke(()=>r.value=M(X))}function te(X){var le;const de=ft(X)?A(X):X;return(le=r.value)==null?void 0:le.treeNodeMap.get(de)}return{tree:r,flattenTree:k,isNotEmpty:$,getKey:A,getChildren:P,toggleExpand:D,toggleCheckbox:a,isExpanded:U,isChecked:s,isIndeterminate:l,isDisabled:ne,isCurrent:j,isForceHiddenExpandIcon:g,handleNodeClick:W,handleNodeCheck:T,getCurrentNode:Q,getCurrentKey:he,setCurrentKey:ee,getCheckedKeys:u,getCheckedNodes:c,getHalfCheckedKeys:d,getHalfCheckedNodes:f,setChecked:p,setCheckedKeys:v,filter:O,setData:Z,getNode:te,expandNode:L,collapseNode:R,setExpandedKeys:H}}var qJ=G({name:"ElTreeNodeContent",props:zJ,setup(e){const t=De(Xh),n=ye("tree");return()=>{const o=e.node,{data:r}=o;return t!=null&&t.ctx.slots.default?t.ctx.slots.default({node:o,data:r}):je("span",{class:n.be("node","label")},[o==null?void 0:o.label])}}});const YJ=["aria-expanded","aria-disabled","aria-checked","data-key","onClick"],GJ=G({name:"ElTreeNode"}),XJ=G({...GJ,props:VJ,emits:KJ,setup(e,{emit:t}){const n=e,o=De(Xh),r=ye("tree"),l=C(()=>{var f;return(f=o==null?void 0:o.props.indent)!=null?f:16}),s=C(()=>{var f;return(f=o==null?void 0:o.props.icon)!=null?f:sc}),a=f=>{t("click",n.node,f)},u=()=>{t("toggle",n.node)},c=f=>{t("check",n.node,f)},d=f=>{var p,v,m,h;(m=(v=(p=o==null?void 0:o.instance)==null?void 0:p.vnode)==null?void 0:v.props)!=null&&m.onNodeContextmenu&&(f.stopPropagation(),f.preventDefault()),o==null||o.ctx.emit(Q_,f,(h=n.node)==null?void 0:h.data,n.node)};return(f,p)=>{var v,m,h;return S(),x("div",{ref:"node$",class:E([i(r).b("node"),i(r).is("expanded",f.expanded),i(r).is("current",f.current),i(r).is("focusable",!f.disabled),i(r).is("checked",!f.disabled&&f.checked)]),role:"treeitem",tabindex:"-1","aria-expanded":f.expanded,"aria-disabled":f.disabled,"aria-checked":f.checked,"data-key":(v=f.node)==null?void 0:v.key,onClick:Ge(a,["stop"]),onContextmenu:d},[I("div",{class:E(i(r).be("node","content")),style:He({paddingLeft:`${(f.node.level-1)*i(l)}px`,height:f.itemSize+"px"})},[i(s)?(S(),ae(i(ze),{key:0,class:E([i(r).is("leaf",!!((m=f.node)!=null&&m.isLeaf)),i(r).is("hidden",f.hiddenExpandIcon),{expanded:!((h=f.node)!=null&&h.isLeaf)&&f.expanded},i(r).be("node","expand-icon")]),onClick:Ge(u,["stop"])},{default:q(()=>[(S(),ae(vt(i(s))))]),_:1},8,["class","onClick"])):oe("v-if",!0),f.showCheckbox?(S(),ae(i(oo),{key:1,"model-value":f.checked,indeterminate:f.indeterminate,disabled:f.disabled,onChange:c,onClick:p[0]||(p[0]=Ge(()=>{},["stop"]))},null,8,["model-value","indeterminate","disabled"])):oe("v-if",!0),z(i(qJ),{node:f.node},null,8,["node"])],6)],42,YJ)}}});var JJ=Ne(XJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-v2/src/tree-node.vue"]]);const ZJ=G({name:"ElTreeV2"}),QJ=G({...ZJ,props:FJ,emits:HJ,setup(e,{expose:t,emit:n}){const o=e,r=cn(),l=C(()=>o.itemSize);ht(Xh,{ctx:{emit:n,slots:r},props:o,instance:ut()}),ht(xo,void 0);const{t:s}=Ct(),a=ye("tree"),{flattenTree:u,isNotEmpty:c,toggleExpand:d,isExpanded:f,isIndeterminate:p,isChecked:v,isDisabled:m,isCurrent:h,isForceHiddenExpandIcon:g,handleNodeClick:y,handleNodeCheck:w,toggleCheckbox:b,getCurrentNode:_,getCurrentKey:k,setCurrentKey:$,getCheckedKeys:M,getCheckedNodes:O,getHalfCheckedKeys:P,getHalfCheckedNodes:A,setChecked:V,setCheckedKeys:B,filter:D,setData:H,getNode:W,expandNode:F,collapseNode:T,setExpandedKeys:L}=UJ(o,n);return t({toggleCheckbox:b,getCurrentNode:_,getCurrentKey:k,setCurrentKey:$,getCheckedKeys:M,getCheckedNodes:O,getHalfCheckedKeys:P,getHalfCheckedNodes:A,setChecked:V,setCheckedKeys:B,filter:D,setData:H,getNode:W,expandNode:F,collapseNode:T,setExpandedKeys:L}),(R,U)=>{var ne;return S(),x("div",{class:E([i(a).b(),{[i(a).m("highlight-current")]:R.highlightCurrent}]),role:"tree"},[i(c)?(S(),ae(i(l_),{key:0,"class-name":i(a).b("virtual-list"),data:i(u),total:i(u).length,height:R.height,"item-size":i(l),"perf-mode":R.perfMode},{default:q(({data:j,index:Q,style:he})=>[(S(),ae(JJ,{key:j[Q].key,style:He(he),node:j[Q],expanded:i(f)(j[Q]),"show-checkbox":R.showCheckbox,checked:i(v)(j[Q]),indeterminate:i(p)(j[Q]),"item-size":i(l),disabled:i(m)(j[Q]),current:i(h)(j[Q]),"hidden-expand-icon":i(g)(j[Q]),onClick:i(y),onToggle:i(d),onCheck:i(w)},null,8,["style","node","expanded","show-checkbox","checked","indeterminate","item-size","disabled","current","hidden-expand-icon","onClick","onToggle","onCheck"]))]),_:1},8,["class-name","data","total","height","item-size","perf-mode"])):(S(),x("div",{key:1,class:E(i(a).e("empty-block"))},[I("span",{class:E(i(a).e("empty-text"))},ue((ne=R.emptyText)!=null?ne:i(s)("el.tree.emptyText")),3)],2))],2)}}});var eZ=Ne(QJ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tree-v2/src/tree.vue"]]);const tZ=it(eZ),eC=Symbol("uploadContextKey"),nZ="ElUpload";class oZ extends Error{constructor(t,n,o,r){super(t),this.name="UploadAjaxError",this.status=n,this.method=o,this.url=r}}function Sy(e,t,n){let o;return n.response?o=`${n.response.error||n.response}`:n.responseText?o=`${n.responseText}`:o=`fail to ${t.method} ${e} ${n.status}`,new oZ(o,n.status,t.method,e)}function rZ(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}const lZ=e=>{typeof XMLHttpRequest>"u"&&en(nZ,"XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",l=>{const s=l;s.percent=l.total>0?l.loaded/l.total*100:0,e.onProgress(s)});const o=new FormData;if(e.data)for(const[l,s]of Object.entries(e.data))Array.isArray(s)?o.append(l,...s):o.append(l,s);o.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(Sy(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(Sy(n,e,t));e.onSuccess(rZ(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const r=e.headers||{};if(r instanceof Headers)r.forEach((l,s)=>t.setRequestHeader(s,l));else for(const[l,s]of Object.entries(r))nn(s)||t.setRequestHeader(l,String(s));return t.send(o),t},tC=["text","picture","picture-card"];let sZ=1;const jf=()=>Date.now()+sZ++,nC=Me({action:{type:String,default:"#"},headers:{type:se(Object)},method:{type:String,default:"post"},data:{type:Object,default:()=>Ft({})},multiple:{type:Boolean,default:!1},name:{type:String,default:"file"},drag:{type:Boolean,default:!1},withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},type:{type:String,default:"select"},fileList:{type:se(Array),default:()=>Ft([])},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:tC,default:"text"},httpRequest:{type:se(Function),default:lZ},disabled:Boolean,limit:Number}),aZ=Me({...nC,beforeUpload:{type:se(Function),default:Ot},beforeRemove:{type:se(Function)},onRemove:{type:se(Function),default:Ot},onChange:{type:se(Function),default:Ot},onPreview:{type:se(Function),default:Ot},onSuccess:{type:se(Function),default:Ot},onProgress:{type:se(Function),default:Ot},onError:{type:se(Function),default:Ot},onExceed:{type:se(Function),default:Ot}}),iZ=Me({files:{type:se(Array),default:()=>Ft([])},disabled:{type:Boolean,default:!1},handlePreview:{type:se(Function),default:Ot},listType:{type:String,values:tC,default:"text"}}),uZ={remove:e=>!!e},cZ=["onKeydown"],dZ=["src"],fZ=["onClick"],pZ=["onClick"],hZ=["onClick"],vZ=G({name:"ElUploadList"}),mZ=G({...vZ,props:iZ,emits:uZ,setup(e,{emit:t}){const{t:n}=Ct(),o=ye("upload"),r=ye("icon"),l=ye("list"),s=xn(),a=N(!1),u=c=>{t("remove",c)};return(c,d)=>(S(),ae(ub,{tag:"ul",class:E([i(o).b("list"),i(o).bm("list",c.listType),i(o).is("disabled",i(s))]),name:i(l).b()},{default:q(()=>[(S(!0),x(xe,null,lt(c.files,f=>(S(),x("li",{key:f.uid||f.name,class:E([i(o).be("list","item"),i(o).is(f.status),{focusing:a.value}]),tabindex:"0",onKeydown:wt(p=>!i(s)&&u(f),["delete"]),onFocus:d[0]||(d[0]=p=>a.value=!0),onBlur:d[1]||(d[1]=p=>a.value=!1),onClick:d[2]||(d[2]=p=>a.value=!1)},[ve(c.$slots,"default",{file:f},()=>[c.listType==="picture"||f.status!=="uploading"&&c.listType==="picture-card"?(S(),x("img",{key:0,class:E(i(o).be("list","item-thumbnail")),src:f.url,alt:""},null,10,dZ)):oe("v-if",!0),f.status==="uploading"||c.listType!=="picture-card"?(S(),x("div",{key:1,class:E(i(o).be("list","item-info"))},[I("a",{class:E(i(o).be("list","item-name")),onClick:Ge(p=>c.handlePreview(f),["prevent"])},[z(i(ze),{class:E(i(r).m("document"))},{default:q(()=>[z(i(uP))]),_:1},8,["class"]),I("span",{class:E(i(o).be("list","item-file-name"))},ue(f.name),3)],10,fZ),f.status==="uploading"?(S(),ae(i(X2),{key:0,type:c.listType==="picture-card"?"circle":"line","stroke-width":c.listType==="picture-card"?6:2,percentage:Number(f.percentage),style:He(c.listType==="picture-card"?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):oe("v-if",!0)],2)):oe("v-if",!0),I("label",{class:E(i(o).be("list","item-status-label"))},[c.listType==="text"?(S(),ae(i(ze),{key:0,class:E([i(r).m("upload-success"),i(r).m("circle-check")])},{default:q(()=>[z(i(jp))]),_:1},8,["class"])):["picture-card","picture"].includes(c.listType)?(S(),ae(i(ze),{key:1,class:E([i(r).m("upload-success"),i(r).m("check")])},{default:q(()=>[z(i(Ja))]),_:1},8,["class"])):oe("v-if",!0)],2),i(s)?oe("v-if",!0):(S(),ae(i(ze),{key:2,class:E(i(r).m("close")),onClick:p=>u(f)},{default:q(()=>[z(i(vo))]),_:2},1032,["class","onClick"])),oe(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),oe(" This is a bug which needs to be fixed "),oe(" TODO: Fix the incorrect navigation interaction "),i(s)?oe("v-if",!0):(S(),x("i",{key:3,class:E(i(r).m("close-tip"))},ue(i(n)("el.upload.deleteTip")),3)),c.listType==="picture-card"?(S(),x("span",{key:4,class:E(i(o).be("list","item-actions"))},[I("span",{class:E(i(o).be("list","item-preview")),onClick:p=>c.handlePreview(f)},[z(i(ze),{class:E(i(r).m("zoom-in"))},{default:q(()=>[z(i(d1))]),_:1},8,["class"])],10,pZ),i(s)?oe("v-if",!0):(S(),x("span",{key:0,class:E(i(o).be("list","item-delete")),onClick:p=>u(f)},[z(i(ze),{class:E(i(r).m("delete"))},{default:q(()=>[z(i(oP))]),_:1},8,["class"])],10,hZ))],2)):oe("v-if",!0)])],42,cZ))),128)),ve(c.$slots,"append")]),_:3},8,["class","name"]))}});var ky=Ne(mZ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-list.vue"]]);const gZ=Me({disabled:{type:Boolean,default:!1}}),yZ={file:e=>Ve(e)},bZ=["onDrop","onDragover"],oC="ElUploadDrag",wZ=G({name:oC}),_Z=G({...wZ,props:gZ,emits:yZ,setup(e,{emit:t}){const n=De(eC);n||en(oC,"usage: ");const o=ye("upload"),r=N(!1),l=xn(),s=u=>{if(l.value)return;r.value=!1,u.stopPropagation();const c=Array.from(u.dataTransfer.files),d=n.accept.value;if(!d){t("file",c);return}const f=c.filter(p=>{const{type:v,name:m}=p,h=m.includes(".")?`.${m.split(".").pop()}`:"",g=v.replace(/\/.*$/,"");return d.split(",").map(y=>y.trim()).filter(y=>y).some(y=>y.startsWith(".")?h===y:/\/\*$/.test(y)?g===y.replace(/\/\*$/,""):/^[^/]+\/[^/]+$/.test(y)?v===y:!1)});t("file",f)},a=()=>{l.value||(r.value=!0)};return(u,c)=>(S(),x("div",{class:E([i(o).b("dragger"),i(o).is("dragover",r.value)]),onDrop:Ge(s,["prevent"]),onDragover:Ge(a,["prevent"]),onDragleave:c[0]||(c[0]=Ge(d=>r.value=!1,["prevent"]))},[ve(u.$slots,"default")],42,bZ))}});var CZ=Ne(_Z,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-dragger.vue"]]);const SZ=Me({...nC,beforeUpload:{type:se(Function),default:Ot},onRemove:{type:se(Function),default:Ot},onStart:{type:se(Function),default:Ot},onSuccess:{type:se(Function),default:Ot},onProgress:{type:se(Function),default:Ot},onError:{type:se(Function),default:Ot},onExceed:{type:se(Function),default:Ot}}),kZ=["onKeydown"],$Z=["name","multiple","accept"],EZ=G({name:"ElUploadContent",inheritAttrs:!1}),TZ=G({...EZ,props:SZ,setup(e,{expose:t}){const n=e,o=ye("upload"),r=xn(),l=Pt({}),s=Pt(),a=m=>{if(m.length===0)return;const{autoUpload:h,limit:g,fileList:y,multiple:w,onStart:b,onExceed:_}=n;if(g&&y.length+m.length>g){_(m,y);return}w||(m=m.slice(0,1));for(const k of m){const $=k;$.uid=jf(),b($),h&&u($)}},u=async m=>{if(s.value.value="",!n.beforeUpload)return c(m);let h,g={};try{const w=n.beforeUpload(m);g=ft(n.data)?zp(n.data):n.data,h=await w}catch{h=!1}if(h===!1){n.onRemove(m);return}let y=m;h instanceof Blob&&(h instanceof File?y=h:y=new File([h],m.name,{type:m.type})),c(Object.assign(y,{uid:m.uid}),g)},c=(m,h)=>{const{headers:g,data:y,method:w,withCredentials:b,name:_,action:k,onProgress:$,onSuccess:M,onError:O,httpRequest:P}=n,{uid:A}=m,V={headers:g||{},withCredentials:b,file:m,data:h??y,method:w,filename:_,action:k,onProgress:D=>{$(D,m)},onSuccess:D=>{M(D,m),delete l.value[A]},onError:D=>{O(D,m),delete l.value[A]}},B=P(V);l.value[A]=B,B instanceof Promise&&B.then(V.onSuccess,V.onError)},d=m=>{const h=m.target.files;h&&a(Array.from(h))},f=()=>{r.value||(s.value.value="",s.value.click())},p=()=>{f()};return t({abort:m=>{QN(l.value).filter(m?([g])=>String(m.uid)===g:()=>!0).forEach(([g,y])=>{y instanceof XMLHttpRequest&&y.abort(),delete l.value[g]})},upload:u}),(m,h)=>(S(),x("div",{class:E([i(o).b(),i(o).m(m.listType),i(o).is("drag",m.drag)]),tabindex:"0",onClick:f,onKeydown:wt(Ge(p,["self"]),["enter","space"])},[m.drag?(S(),ae(CZ,{key:0,disabled:i(r),onFile:a},{default:q(()=>[ve(m.$slots,"default")]),_:3},8,["disabled"])):ve(m.$slots,"default",{key:1}),I("input",{ref_key:"inputRef",ref:s,class:E(i(o).e("input")),name:m.name,multiple:m.multiple,accept:m.accept,type:"file",onChange:d,onClick:h[0]||(h[0]=Ge(()=>{},["stop"]))},null,42,$Z)],42,kZ))}});var $y=Ne(TZ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload-content.vue"]]);const Ey="ElUpload",OZ=e=>{var t;(t=e.url)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(e.url)},NZ=(e,t)=>{const n=K$(e,"fileList",void 0,{passive:!0}),o=p=>n.value.find(v=>v.uid===p.uid);function r(p){var v;(v=t.value)==null||v.abort(p)}function l(p=["ready","uploading","success","fail"]){n.value=n.value.filter(v=>!p.includes(v.status))}const s=(p,v)=>{const m=o(v);m&&(console.error(p),m.status="fail",n.value.splice(n.value.indexOf(m),1),e.onError(p,m,n.value),e.onChange(m,n.value))},a=(p,v)=>{const m=o(v);m&&(e.onProgress(p,m,n.value),m.status="uploading",m.percentage=Math.round(p.percent))},u=(p,v)=>{const m=o(v);m&&(m.status="success",m.response=p,e.onSuccess(p,m,n.value),e.onChange(m,n.value))},c=p=>{nn(p.uid)&&(p.uid=jf());const v={name:p.name,percentage:0,status:"ready",size:p.size,raw:p,uid:p.uid};if(e.listType==="picture-card"||e.listType==="picture")try{v.url=URL.createObjectURL(p)}catch(m){m.message,e.onError(m,v,n.value)}n.value=[...n.value,v],e.onChange(v,n.value)},d=async p=>{const v=p instanceof File?o(p):p;v||en(Ey,"file to be removed not found");const m=h=>{r(h);const g=n.value;g.splice(g.indexOf(h),1),e.onRemove(h,g),OZ(h)};e.beforeRemove?await e.beforeRemove(v,n.value)!==!1&&m(v):m(v)};function f(){n.value.filter(({status:p})=>p==="ready").forEach(({raw:p})=>{var v;return p&&((v=t.value)==null?void 0:v.upload(p))})}return me(()=>e.listType,p=>{p!=="picture-card"&&p!=="picture"||(n.value=n.value.map(v=>{const{raw:m,url:h}=v;if(!h&&m)try{v.url=URL.createObjectURL(m)}catch(g){e.onError(g,v,n.value)}return v}))}),me(n,p=>{for(const v of p)v.uid||(v.uid=jf()),v.status||(v.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:r,clearFiles:l,handleError:s,handleProgress:a,handleStart:c,handleSuccess:u,handleRemove:d,submit:f}},MZ=G({name:"ElUpload"}),IZ=G({...MZ,props:aZ,setup(e,{expose:t}){const n=e,o=cn(),r=xn(),l=Pt(),{abort:s,submit:a,clearFiles:u,uploadFiles:c,handleStart:d,handleError:f,handleRemove:p,handleSuccess:v,handleProgress:m}=NZ(n,l),h=C(()=>n.listType==="picture-card"),g=C(()=>({...n,fileList:c.value,onStart:d,onProgress:m,onSuccess:v,onError:f,onRemove:p}));return Dt(()=>{c.value.forEach(({url:y})=>{y!=null&&y.startsWith("blob:")&&URL.revokeObjectURL(y)})}),ht(eC,{accept:Lt(n,"accept")}),t({abort:s,submit:a,clearFiles:u,handleStart:d,handleRemove:p}),(y,w)=>(S(),x("div",null,[i(h)&&y.showFileList?(S(),ae(ky,{key:0,disabled:i(r),"list-type":y.listType,files:i(c),"handle-preview":y.onPreview,onRemove:i(p)},Xo({append:q(()=>[z($y,pt({ref_key:"uploadRef",ref:l},i(g)),{default:q(()=>[i(o).trigger?ve(y.$slots,"trigger",{key:0}):oe("v-if",!0),!i(o).trigger&&i(o).default?ve(y.$slots,"default",{key:1}):oe("v-if",!0)]),_:3},16)]),_:2},[y.$slots.file?{name:"default",fn:q(({file:b})=>[ve(y.$slots,"file",{file:b})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):oe("v-if",!0),!i(h)||i(h)&&!y.showFileList?(S(),ae($y,pt({key:1,ref_key:"uploadRef",ref:l},i(g)),{default:q(()=>[i(o).trigger?ve(y.$slots,"trigger",{key:0}):oe("v-if",!0),!i(o).trigger&&i(o).default?ve(y.$slots,"default",{key:1}):oe("v-if",!0)]),_:3},16)):oe("v-if",!0),y.$slots.trigger?ve(y.$slots,"default",{key:2}):oe("v-if",!0),ve(y.$slots,"tip"),!i(h)&&y.showFileList?(S(),ae(ky,{key:3,disabled:i(r),"list-type":y.listType,files:i(c),"handle-preview":y.onPreview,onRemove:i(p)},Xo({_:2},[y.$slots.file?{name:"default",fn:q(({file:b})=>[ve(y.$slots,"file",{file:b})])}:void 0]),1032,["disabled","list-type","files","handle-preview","onRemove"])):oe("v-if",!0)]))}});var PZ=Ne(IZ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/upload/src/upload.vue"]]);const RZ=it(PZ);var AZ=[t6,f6,BD,ZG,WD,ZD,mw,dB,fB,Zt,Sw,P5,D5,J5,Z5,fV,ZF,yV,oo,yF,Yw,s2,UV,qV,i2,Cz,q8,v2,Az,m2,g2,y2,qH,o9,r9,b9,M2,R9,kK,$K,EK,Sc,lL,sL,ze,y7,F2,mn,V2,z2,J7,Z7,Q7,ej,aj,Oh,gW,EW,pw,X2,t2,AF,RF,KW,YW,l2,or,vl,Ou,Bj,BU,UU,qU,Sq,Oq,v_,Fq,Yq,Gq,sY,pG,hG,JG,Hh,Kh,Ta,gX,c5,SX,OX,NX,En,tJ,mJ,MJ,DJ,tZ,RZ];const so="ElInfiniteScroll",xZ=50,LZ=200,DZ=0,BZ={delay:{type:Number,default:LZ},distance:{type:Number,default:DZ},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},Jh=(e,t)=>Object.entries(BZ).reduce((n,[o,r])=>{var l,s;const{type:a,default:u}=r,c=e.getAttribute(`infinite-scroll-${o}`);let d=(s=(l=t[c])!=null?l:c)!=null?s:u;return d=d==="false"?!1:d,d=a(d),n[o]=Number.isNaN(d)?u:d,n},{}),rC=e=>{const{observer:t}=e[so];t&&(t.disconnect(),delete e[so].observer)},FZ=(e,t)=>{const{container:n,containerEl:o,instance:r,observer:l,lastScrollTop:s}=e[so],{disabled:a,distance:u}=Jh(e,r),{clientHeight:c,scrollHeight:d,scrollTop:f}=o,p=f-s;if(e[so].lastScrollTop=f,l||a||p<0)return;let v=!1;if(n===e)v=d-(c+f)<=u;else{const{clientTop:m,scrollHeight:h}=e,g=q$(e,o);v=f+c>=g+m+h-u}v&&t.call(r)};function fd(e,t){const{containerEl:n,instance:o}=e[so],{disabled:r}=Jh(e,o);r||n.clientHeight===0||(n.scrollHeight<=n.clientHeight?t.call(o):rC(e))}const VZ={async mounted(e,t){const{instance:n,value:o}=t;Je(o)||en(so,"'v-infinite-scroll' binding value must be a function"),await Ke();const{delay:r,immediate:l}=Jh(e,n),s=Kp(e,!0),a=s===window?document.documentElement:s,u=il(FZ.bind(null,e,o),r);if(s){if(e[so]={instance:n,container:s,containerEl:a,delay:r,cb:o,onScroll:u,lastScrollTop:a.scrollTop},l){const c=new MutationObserver(il(fd.bind(null,e,o),xZ));e[so].observer=c,c.observe(e,{childList:!0,subtree:!0}),fd(e,o)}s.addEventListener("scroll",u)}},unmounted(e){const{container:t,onScroll:n}=e[so];t==null||t.removeEventListener("scroll",n),rC(e)},async updated(e){if(!e[so])await Ke();else{const{containerEl:t,cb:n,observer:o}=e[so];t.clientHeight&&o&&fd(e,n)}}},Wf=VZ;Wf.install=e=>{e.directive("InfiniteScroll",Wf)};const zZ=Wf;function HZ(e){let t;const n=N(!1),o=yt({...e,originalPosition:"",originalOverflow:"",visible:!1});function r(p){o.text=p}function l(){const p=o.parent,v=f.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(In(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),In(p,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var p,v;(v=(p=f.$el)==null?void 0:p.parentNode)==null||v.removeChild(f.$el)}function a(){var p;e.beforeClose&&!e.beforeClose()||(n.value=!0,clearTimeout(t),t=window.setTimeout(u,400),o.visible=!1,(p=e.closed)==null||p.call(e))}function u(){if(!n.value)return;const p=o.parent;n.value=!1,p.vLoadingAddClassList=void 0,l()}const c=G({name:"ElLoading",setup(p,{expose:v}){const{ns:m}=gc("loading"),h=Sl();return v({ns:m,zIndex:h}),()=>{const g=o.spinner||o.svg,y=je("svg",{class:"circular",viewBox:o.svgViewBox?o.svgViewBox:"0 0 50 50",...g?{innerHTML:g}:{}},[je("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),w=o.text?je("p",{class:m.b("text")},[o.text]):void 0;return je(Yt,{name:m.b("fade"),onAfterLeave:u},{default:q(()=>[et(z("div",{style:{backgroundColor:o.background||""},class:[m.b("mask"),o.customClass,o.fullscreen?"is-fullscreen":""]},[je("div",{class:m.b("spinner")},[y,w])]),[[kt,o.visible]])])})}}}),d=hb(c),f=d.mount(document.createElement("div"));return{...Qt(o),setText:r,removeElLoadingChild:s,close:a,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let Pi;const Uf=function(e={}){if(!bt)return;const t=KZ(e);if(t.fullscreen&&Pi)return Pi;const n=HZ({...t,closed:()=>{var r;(r=t.closed)==null||r.call(t),t.fullscreen&&(Pi=void 0)}});jZ(t,t.parent,n),Ty(t,t.parent,n),t.parent.vLoadingAddClassList=()=>Ty(t,t.parent,n);let o=t.parent.getAttribute("loading-number");return o?o=`${Number.parseInt(o)+1}`:o="1",t.parent.setAttribute("loading-number",o),t.parent.appendChild(n.$el),Ke(()=>n.visible.value=t.visible),t.fullscreen&&(Pi=n),n},KZ=e=>{var t,n,o,r;let l;return Ze(e.target)?l=(t=document.querySelector(e.target))!=null?t:document.body:l=e.target||document.body,{parent:l===document.body||e.body?document.body:l,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:l===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(o=e.lock)!=null?o:!1,customClass:e.customClass||"",visible:(r=e.visible)!=null?r:!0,target:l}},jZ=async(e,t,n)=>{const{nextZIndex:o}=n.vm.zIndex,r={};if(e.fullscreen)n.originalPosition.value=jo(document.body,"position"),n.originalOverflow.value=jo(document.body,"overflow"),r.zIndex=o();else if(e.parent===document.body){n.originalPosition.value=jo(document.body,"position"),await Ke();for(const l of["top","left"]){const s=l==="top"?"scrollTop":"scrollLeft";r[l]=`${e.target.getBoundingClientRect()[l]+document.body[s]+document.documentElement[s]-Number.parseInt(jo(document.body,`margin-${l}`),10)}px`}for(const l of["height","width"])r[l]=`${e.target.getBoundingClientRect()[l]}px`}else n.originalPosition.value=jo(t,"position");for(const[l,s]of Object.entries(r))n.$el.style[l]=s},Ty=(e,t,n)=>{const o=n.vm.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?In(t,o.bm("parent","relative")):To(t,o.bm("parent","relative")),e.fullscreen&&e.lock?To(t,o.bm("parent","hidden")):In(t,o.bm("parent","hidden"))},qf=Symbol("ElLoading"),Oy=(e,t)=>{var n,o,r,l;const s=t.instance,a=p=>ft(t.value)?t.value[p]:void 0,u=p=>{const v=Ze(p)&&(s==null?void 0:s[p])||p;return v&&N(v)},c=p=>u(a(p)||e.getAttribute(`element-loading-${Rr(p)}`)),d=(n=a("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(o=a("target"))!=null?o:d?void 0:e,body:(r=a("body"))!=null?r:t.modifiers.body,lock:(l=a("lock"))!=null?l:t.modifiers.lock};e[qf]={options:f,instance:Uf(f)}},WZ=(e,t)=>{for(const n of Object.keys(t))It(t[n])&&(t[n].value=e[n])},Ny={mounted(e,t){t.value&&Oy(e,t)},updated(e,t){const n=e[qf];t.oldValue!==t.value&&(t.value&&!t.oldValue?Oy(e,t):t.value&&t.oldValue?ft(t.value)&&WZ(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[qf])==null||t.instance.close()}},lC={install(e){e.directive("loading",Ny),e.config.globalProperties.$loading=Uf},directive:Ny,service:Uf},sC=["success","info","warning","error"],Nn=Ft({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:bt?document.body:void 0}),UZ=Me({customClass:{type:String,default:Nn.customClass},center:{type:Boolean,default:Nn.center},dangerouslyUseHTMLString:{type:Boolean,default:Nn.dangerouslyUseHTMLString},duration:{type:Number,default:Nn.duration},icon:{type:Rt,default:Nn.icon},id:{type:String,default:Nn.id},message:{type:se([String,Object,Function]),default:Nn.message},onClose:{type:se(Function),required:!1},showClose:{type:Boolean,default:Nn.showClose},type:{type:String,values:sC,default:Nn.type},offset:{type:Number,default:Nn.offset},zIndex:{type:Number,default:Nn.zIndex},grouping:{type:Boolean,default:Nn.grouping},repeatNum:{type:Number,default:Nn.repeatNum}}),qZ={destroy:()=>!0},co=_0([]),YZ=e=>{const t=co.findIndex(r=>r.id===e),n=co[t];let o;return t>0&&(o=co[t-1]),{current:n,prev:o}},GZ=e=>{const{prev:t}=YZ(e);return t?t.vm.exposed.bottom.value:0},XZ=(e,t)=>co.findIndex(o=>o.id===e)>0?20:t,JZ=["id"],ZZ=["innerHTML"],QZ=G({name:"ElMessage"}),eQ=G({...QZ,props:UZ,emits:qZ,setup(e,{expose:t}){const n=e,{Close:o}=qp,{ns:r,zIndex:l}=gc("message"),{currentZIndex:s,nextZIndex:a}=l,u=N(),c=N(!1),d=N(0);let f;const p=C(()=>n.type?n.type==="error"?"danger":n.type:"info"),v=C(()=>{const M=n.type;return{[r.bm("icon",M)]:M&&Or[M]}}),m=C(()=>n.icon||Or[n.type]||""),h=C(()=>GZ(n.id)),g=C(()=>XZ(n.id,n.offset)+h.value),y=C(()=>d.value+g.value),w=C(()=>({top:`${g.value}px`,zIndex:s.value}));function b(){n.duration!==0&&({stop:f}=pl(()=>{k()},n.duration))}function _(){f==null||f()}function k(){c.value=!1}function $({code:M}){M===We.esc&&k()}return tt(()=>{b(),a(),c.value=!0}),me(()=>n.repeatNum,()=>{_(),b()}),Vt(document,"keydown",$),gn(u,()=>{d.value=u.value.getBoundingClientRect().height}),t({visible:c,bottom:y,close:k}),(M,O)=>(S(),ae(Yt,{name:i(r).b("fade"),onBeforeLeave:M.onClose,onAfterLeave:O[0]||(O[0]=P=>M.$emit("destroy")),persisted:""},{default:q(()=>[et(I("div",{id:M.id,ref_key:"messageRef",ref:u,class:E([i(r).b(),{[i(r).m(M.type)]:M.type&&!M.icon},i(r).is("center",M.center),i(r).is("closable",M.showClose),M.customClass]),style:He(i(w)),role:"alert",onMouseenter:_,onMouseleave:b},[M.repeatNum>1?(S(),ae(i(mw),{key:0,value:M.repeatNum,type:i(p),class:E(i(r).e("badge"))},null,8,["value","type","class"])):oe("v-if",!0),i(m)?(S(),ae(i(ze),{key:1,class:E([i(r).e("icon"),i(v)])},{default:q(()=>[(S(),ae(vt(i(m))))]),_:1},8,["class"])):oe("v-if",!0),ve(M.$slots,"default",{},()=>[M.dangerouslyUseHTMLString?(S(),x(xe,{key:1},[oe(" Caution here, message could've been compromised, never use user's input as message "),I("p",{class:E(i(r).e("content")),innerHTML:M.message},null,10,ZZ)],2112)):(S(),x("p",{key:0,class:E(i(r).e("content"))},ue(M.message),3))]),M.showClose?(S(),ae(i(ze),{key:2,class:E(i(r).e("closeBtn")),onClick:Ge(k,["stop"])},{default:q(()=>[z(i(o))]),_:1},8,["class","onClick"])):oe("v-if",!0)],46,JZ),[[kt,c.value]])]),_:3},8,["name","onBeforeLeave"]))}});var tQ=Ne(eQ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/message/src/message.vue"]]);let nQ=1;const aC=e=>{const t=!e||Ze(e)||zt(e)||Je(e)?{message:e}:e,n={...Nn,...t};if(!n.appendTo)n.appendTo=document.body;else if(Ze(n.appendTo)){let o=document.querySelector(n.appendTo);ho(o)||(o=document.body),n.appendTo=o}return n},oQ=e=>{const t=co.indexOf(e);if(t===-1)return;co.splice(t,1);const{handler:n}=e;n.close()},rQ=({appendTo:e,...t},n)=>{const o=`message_${nQ++}`,r=t.onClose,l=document.createElement("div"),s={...t,id:o,onClose:()=>{r==null||r(),oQ(d)},onDestroy:()=>{Ql(null,l)}},a=z(tQ,s,Je(s.message)||zt(s.message)?{default:Je(s.message)?s.message:()=>s.message}:null);a.appContext=n||fs._context,Ql(a,l),e.appendChild(l.firstElementChild);const u=a.component,d={id:o,vnode:a,vm:u,handler:{close:()=>{u.exposed.visible.value=!1}},props:a.component.props};return d},fs=(e={},t)=>{if(!bt)return{close:()=>{}};if(Xe(Kd.max)&&co.length>=Kd.max)return{close:()=>{}};const n=aC(e);if(n.grouping&&co.length){const r=co.find(({vnode:l})=>{var s;return((s=l.props)==null?void 0:s.message)===n.message});if(r)return r.props.repeatNum+=1,r.props.type=n.type,r.handler}const o=rQ(n,t);return co.push(o),o.handler};sC.forEach(e=>{fs[e]=(t={},n)=>{const o=aC(t);return fs({...o,type:e},n)}});function lQ(e){for(const t of co)(!e||e===t.props.type)&&t.handler.close()}fs.closeAll=lQ;fs._context=null;const Ir=v1(fs,"$message"),sQ=G({name:"ElMessageBox",directives:{TrapFocus:UB},components:{ElButton:Zt,ElFocusTrap:bc,ElInput:mn,ElOverlay:_h,ElIcon:ze,...qp},inheritAttrs:!1,props:{buttonSize:{type:String,validator:uc},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:o,ns:r,size:l}=gc("message-box",C(()=>e.buttonSize)),{t:s}=n,{nextZIndex:a}=o,u=N(!1),c=yt({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:a()}),d=C(()=>{const W=c.type;return{[r.bm("icon",W)]:W&&Or[W]}}),f=no(),p=no(),v=C(()=>c.icon||Or[c.type]||""),m=C(()=>!!c.message),h=N(),g=N(),y=N(),w=N(),b=N(),_=C(()=>c.confirmButtonClass);me(()=>c.inputValue,async W=>{await Ke(),e.boxType==="prompt"&&W!==null&&V()},{immediate:!0}),me(()=>u.value,W=>{var F,T;W&&(e.boxType!=="prompt"&&(c.autofocus?y.value=(T=(F=b.value)==null?void 0:F.$el)!=null?T:h.value:y.value=h.value),c.zIndex=a()),e.boxType==="prompt"&&(W?Ke().then(()=>{var L;w.value&&w.value.$el&&(c.autofocus?y.value=(L=B())!=null?L:h.value:y.value=h.value)}):(c.editorErrorMessage="",c.validateError=!1))});const k=C(()=>e.draggable);g1(h,g,k),tt(async()=>{await Ke(),e.closeOnHashChange&&window.addEventListener("hashchange",$)}),Dt(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",$)});function $(){u.value&&(u.value=!1,Ke(()=>{c.action&&t("action",c.action)}))}const M=()=>{e.closeOnClickModal&&A(c.distinguishCancelAndClose?"close":"cancel")},O=rh(M),P=W=>{if(c.inputType!=="textarea")return W.preventDefault(),A("confirm")},A=W=>{var F;e.boxType==="prompt"&&W==="confirm"&&!V()||(c.action=W,c.beforeClose?(F=c.beforeClose)==null||F.call(c,W,c,$):$())},V=()=>{if(e.boxType==="prompt"){const W=c.inputPattern;if(W&&!W.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||s("el.messagebox.error"),c.validateError=!0,!1;const F=c.inputValidator;if(typeof F=="function"){const T=F(c.inputValue);if(T===!1)return c.editorErrorMessage=c.inputErrorMessage||s("el.messagebox.error"),c.validateError=!0,!1;if(typeof T=="string")return c.editorErrorMessage=T,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},B=()=>{const W=w.value.$refs;return W.input||W.textarea},D=()=>{A("close")},H=()=>{e.closeOnPressEscape&&D()};return e.lockScroll&&w1(u),g8(u),{...Qt(c),ns:r,overlayEvent:O,visible:u,hasMessage:m,typeClass:d,contentId:f,inputId:p,btnSize:l,iconComponent:v,confirmButtonClasses:_,rootRef:h,focusStartRef:y,headerRef:g,inputRef:w,confirmRef:b,doClose:$,handleClose:D,onCloseRequested:H,handleWrapperClick:M,handleInputEnter:P,handleAction:A,t:s}}}),aQ=["aria-label","aria-describedby"],iQ=["aria-label"],uQ=["id"];function cQ(e,t,n,o,r,l){const s=Qe("el-icon"),a=Qe("close"),u=Qe("el-input"),c=Qe("el-button"),d=Qe("el-focus-trap"),f=Qe("el-overlay");return S(),ae(Yt,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=p=>e.$emit("vanish")),persisted:""},{default:q(()=>[et(z(f,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:q(()=>[I("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:E(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...p)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...p)),onMousedown:t[9]||(t[9]=(...p)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...p)),onMouseup:t[10]||(t[10]=(...p)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...p))},[z(d,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:q(()=>[I("div",{ref:"rootRef",class:E([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:He(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=Ge(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(S(),x("div",{key:0,ref:"headerRef",class:E(e.ns.e("header"))},[I("div",{class:E(e.ns.e("title"))},[e.iconComponent&&e.center?(S(),ae(s,{key:0,class:E([e.ns.e("status"),e.typeClass])},{default:q(()=>[(S(),ae(vt(e.iconComponent)))]),_:1},8,["class"])):oe("v-if",!0),I("span",null,ue(e.title),1)],2),e.showClose?(S(),x("button",{key:0,type:"button",class:E(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=p=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=wt(Ge(p=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[z(s,{class:E(e.ns.e("close"))},{default:q(()=>[z(a)]),_:1},8,["class"])],42,iQ)):oe("v-if",!0)],2)):oe("v-if",!0),I("div",{id:e.contentId,class:E(e.ns.e("content"))},[I("div",{class:E(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(S(),ae(s,{key:0,class:E([e.ns.e("status"),e.typeClass])},{default:q(()=>[(S(),ae(vt(e.iconComponent)))]),_:1},8,["class"])):oe("v-if",!0),e.hasMessage?(S(),x("div",{key:1,class:E(e.ns.e("message"))},[ve(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(S(),ae(vt(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(S(),ae(vt(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:q(()=>[nt(ue(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):oe("v-if",!0)],2),et(I("div",{class:E(e.ns.e("input"))},[z(u,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=p=>e.inputValue=p),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:E({invalid:e.validateError}),onKeydown:wt(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),I("div",{class:E(e.ns.e("errormsg")),style:He({visibility:e.editorErrorMessage?"visible":"hidden"})},ue(e.editorErrorMessage),7)],2),[[kt,e.showInput]])],10,uQ),I("div",{class:E(e.ns.e("btns"))},[e.showCancelButton?(S(),ae(c,{key:0,loading:e.cancelButtonLoading,class:E([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=p=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=wt(Ge(p=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:q(()=>[nt(ue(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","class","round","size"])):oe("v-if",!0),et(z(c,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,class:E([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=p=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=wt(Ge(p=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:q(()=>[nt(ue(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","class","round","disabled","size"]),[[kt,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,aQ)]),_:3},8,["z-index","overlay-class","mask"]),[[kt,e.visible]])]),_:3})}var dQ=Ne(sQ,[["render",cQ],["__file","/home/runner/work/element-plus/element-plus/packages/components/message-box/src/index.vue"]]);const La=new Map,fQ=e=>{let t=document.body;return e.appendTo&&(Ze(e.appendTo)&&(t=document.querySelector(e.appendTo)),ho(e.appendTo)&&(t=e.appendTo),ho(t)||(t=document.body)),t},pQ=(e,t,n=null)=>{const o=z(dQ,e,Je(e.message)||zt(e.message)?{default:Je(e.message)?e.message:()=>e.message}:null);return o.appContext=n,Ql(o,t),fQ(e).appendChild(t.firstElementChild),o.component},hQ=()=>document.createElement("div"),vQ=(e,t)=>{const n=hQ();e.onVanish=()=>{Ql(null,n),La.delete(r)},e.onAction=l=>{const s=La.get(r);let a;e.showInput?a={value:r.inputValue,action:l}:a=l,e.callback?e.callback(a,o.proxy):l==="cancel"||l==="close"?e.distinguishCancelAndClose&&l!=="cancel"?s.reject("close"):s.reject("cancel"):s.resolve(a)};const o=pQ(e,n,t),r=o.proxy;for(const l in e)gt(e,l)&&!gt(r.$props,l)&&(r[l]=e[l]);return r.visible=!0,r};function $s(e,t=null){if(!bt)return Promise.reject();let n;return Ze(e)||zt(e)?e={message:e}:n=e.callback,new Promise((o,r)=>{const l=vQ(e,t??$s._context);La.set(l,{options:e,callback:n,resolve:o,reject:r})})}const mQ=["alert","confirm","prompt"],gQ={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};mQ.forEach(e=>{$s[e]=yQ(e)});function yQ(e){return(t,n,o,r)=>{let l="";return ft(n)?(o=n,l=""):an(n)?l="":l=n,$s(Object.assign({title:l,message:t,type:"",...gQ[e]},o,{boxType:e}),r)}}$s.close=()=>{La.forEach((e,t)=>{t.doClose()}),La.clear()};$s._context=null;const hr=$s;hr.install=e=>{hr._context=e._context,e.config.globalProperties.$msgbox=hr,e.config.globalProperties.$messageBox=hr,e.config.globalProperties.$alert=hr.alert,e.config.globalProperties.$confirm=hr.confirm,e.config.globalProperties.$prompt=hr.prompt};const bQ=hr,iC=["success","info","warning","error"],wQ=Me({customClass:{type:String,default:""},dangerouslyUseHTMLString:{type:Boolean,default:!1},duration:{type:Number,default:4500},icon:{type:Rt},id:{type:String,default:""},message:{type:se([String,Object]),default:""},offset:{type:Number,default:0},onClick:{type:se(Function),default:()=>{}},onClose:{type:se(Function),required:!0},position:{type:String,values:["top-right","top-left","bottom-right","bottom-left"],default:"top-right"},showClose:{type:Boolean,default:!0},title:{type:String,default:""},type:{type:String,values:[...iC,""],default:""},zIndex:{type:Number,default:0}}),_Q={destroy:()=>!0},CQ=["id"],SQ=["textContent"],kQ={key:0},$Q=["innerHTML"],EQ=G({name:"ElNotification"}),TQ=G({...EQ,props:wQ,emits:_Q,setup(e,{expose:t}){const n=e,{ns:o,zIndex:r}=gc("notification"),{nextZIndex:l,currentZIndex:s}=r,{Close:a}=p1,u=N(!1);let c;const d=C(()=>{const b=n.type;return b&&Or[n.type]?o.m(b):""}),f=C(()=>n.type&&Or[n.type]||n.icon),p=C(()=>n.position.endsWith("right")?"right":"left"),v=C(()=>n.position.startsWith("top")?"top":"bottom"),m=C(()=>({[v.value]:`${n.offset}px`,zIndex:s.value}));function h(){n.duration>0&&({stop:c}=pl(()=>{u.value&&y()},n.duration))}function g(){c==null||c()}function y(){u.value=!1}function w({code:b}){b===We.delete||b===We.backspace?g():b===We.esc?u.value&&y():h()}return tt(()=>{h(),l(),u.value=!0}),Vt(document,"keydown",w),t({visible:u,close:y}),(b,_)=>(S(),ae(Yt,{name:i(o).b("fade"),onBeforeLeave:b.onClose,onAfterLeave:_[1]||(_[1]=k=>b.$emit("destroy")),persisted:""},{default:q(()=>[et(I("div",{id:b.id,class:E([i(o).b(),b.customClass,i(p)]),style:He(i(m)),role:"alert",onMouseenter:g,onMouseleave:h,onClick:_[0]||(_[0]=(...k)=>b.onClick&&b.onClick(...k))},[i(f)?(S(),ae(i(ze),{key:0,class:E([i(o).e("icon"),i(d)])},{default:q(()=>[(S(),ae(vt(i(f))))]),_:1},8,["class"])):oe("v-if",!0),I("div",{class:E(i(o).e("group"))},[I("h2",{class:E(i(o).e("title")),textContent:ue(b.title)},null,10,SQ),et(I("div",{class:E(i(o).e("content")),style:He(b.title?void 0:{margin:0})},[ve(b.$slots,"default",{},()=>[b.dangerouslyUseHTMLString?(S(),x(xe,{key:1},[oe(" Caution here, message could've been compromised, never use user's input as message "),I("p",{innerHTML:b.message},null,8,$Q)],2112)):(S(),x("p",kQ,ue(b.message),1))])],6),[[kt,b.message]]),b.showClose?(S(),ae(i(ze),{key:0,class:E(i(o).e("closeBtn")),onClick:Ge(y,["stop"])},{default:q(()=>[z(i(a))]),_:1},8,["class","onClick"])):oe("v-if",!0)],2)],46,CQ),[[kt,u.value]])]),_:3},8,["name","onBeforeLeave"]))}});var OQ=Ne(TQ,[["__file","/home/runner/work/element-plus/element-plus/packages/components/notification/src/notification.vue"]]);const Du={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},Yf=16;let NQ=1;const ps=function(e={},t=null){if(!bt)return{close:()=>{}};(typeof e=="string"||zt(e))&&(e={message:e});const n=e.position||"top-right";let o=e.offset||0;Du[n].forEach(({vm:d})=>{var f;o+=(((f=d.el)==null?void 0:f.offsetHeight)||0)+Yf}),o+=Yf;const r=`notification_${NQ++}`,l=e.onClose,s={...e,offset:o,id:r,onClose:()=>{MQ(r,n,l)}};let a=document.body;ho(e.appendTo)?a=e.appendTo:Ze(e.appendTo)&&(a=document.querySelector(e.appendTo)),ho(a)||(a=document.body);const u=document.createElement("div"),c=z(OQ,s,zt(s.message)?{default:()=>s.message}:null);return c.appContext=t??ps._context,c.props.onDestroy=()=>{Ql(null,u)},Ql(c,u),Du[n].push({vm:c}),a.appendChild(u.firstElementChild),{close:()=>{c.component.exposed.visible.value=!1}}};iC.forEach(e=>{ps[e]=(t={})=>((typeof t=="string"||zt(t))&&(t={message:t}),ps({...t,type:e}))});function MQ(e,t,n){const o=Du[t],r=o.findIndex(({vm:c})=>{var d;return((d=c.component)==null?void 0:d.props.id)===e});if(r===-1)return;const{vm:l}=o[r];if(!l)return;n==null||n(l);const s=l.el.offsetHeight,a=t.split("-")[0];o.splice(r,1);const u=o.length;if(!(u<1))for(let c=r;c{t.component.exposed.visible.value=!1})}ps.closeAll=IQ;ps._context=null;const PQ=v1(ps,"$notify");var RQ=[zZ,lC,Ir,bQ,PQ,G2],AQ=G8([...AZ,...RQ]);const xQ={class:"util"},LQ=G({__name:"Util",setup(e){const t=yt({show:!1,darkTheme:!0});tt(()=>{n(localStorage.getItem("theme")+"")});const n=o=>{switch(o){case"top":if(document.documentElement.scrollTop>0){const l=setInterval(()=>{document.documentElement.scrollTop-=10,document.documentElement.scrollTop===0&&clearInterval(l)},5)}break;case"light":t.darkTheme=!1,localStorage.setItem("theme","light"),document.getElementsByClassName("main")[0].style.background="radial-gradient(circle, #C147E9, #810CA8, #2D033B)";break;case"dark":t.darkTheme=!0,localStorage.setItem("theme","dark"),document.getElementsByClassName("main")[0].style.background="rgb(34,34,34)";break;case"more":t.show=!t.show;break}};return(o,r)=>{const l=ze,s=i2;return S(),x("div",xQ,[z(s,null,{default:q(()=>[et(I("div",null,[I("a",{href:"javascript:;",onClick:r[0]||(r[0]=a=>n("top"))},[z(l,null,{default:q(()=>[z(i(Xa))]),_:1})]),t.darkTheme?(S(),x("a",{key:0,href:"javascript:;",onClick:r[1]||(r[1]=a=>n("light"))},[z(l,null,{default:q(()=>[z(i(EA))]),_:1})])):oe("",!0),t.darkTheme?oe("",!0):(S(),x("a",{key:1,href:"javascript:;",onClick:r[2]||(r[2]=a=>n("dark"))},[z(l,null,{default:q(()=>[z(i(jP))]),_:1})]))],512),[[kt,t.show]])]),_:1}),I("a",{href:"javascript:;",onClick:r[3]||(r[3]=a=>n("more")),class:"more"},[z(l,null,{default:q(()=>[z(i(Bd))]),_:1})])])}}}),_o=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},DQ=_o(LQ,[["__scopeId","data-v-6cdb3d12"]]),BQ={class:"main"},FQ=G({__name:"App",setup(e){return(t,n)=>{const o=Qe("router-view");return S(),x("div",BQ,[z(o),z(DQ)])}}});/*!
+ * vue-router v4.1.6
+ * (c) 2022 Eduardo San Martin Morote
+ * @license MIT
+ */const Al=typeof window<"u";function VQ(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const xt=Object.assign;function pd(e,t){const n={};for(const o in t){const r=t[o];n[o]=go(r)?r.map(e):e(r)}return n}const ea=()=>{},go=Array.isArray,zQ=/\/$/,HQ=e=>e.replace(zQ,"");function hd(e,t,n="/"){let o,r={},l="",s="";const a=t.indexOf("#");let u=t.indexOf("?");return a=0&&(u=-1),u>-1&&(o=t.slice(0,u),l=t.slice(u+1,a>-1?a:t.length),r=e(l)),a>-1&&(o=o||t.slice(0,a),s=t.slice(a,t.length)),o=UQ(o??t,n),{fullPath:o+(l&&"?")+l+s,path:o,query:r,hash:s}}function KQ(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function My(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function jQ(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&hs(t.matched[o],n.matched[r])&&uC(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function hs(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function uC(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!WQ(e[n],t[n]))return!1;return!0}function WQ(e,t){return go(e)?Iy(e,t):go(t)?Iy(t,e):e===t}function Iy(e,t){return go(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function UQ(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/");let r=n.length-1,l,s;for(l=0;l1&&r--;else break;return n.slice(0,r).join("/")+"/"+o.slice(l-(l===o.length?1:0)).join("/")}var Da;(function(e){e.pop="pop",e.push="push"})(Da||(Da={}));var ta;(function(e){e.back="back",e.forward="forward",e.unknown=""})(ta||(ta={}));function qQ(e){if(!e)if(Al){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),HQ(e)}const YQ=/^[^#]+#/;function GQ(e,t){return e.replace(YQ,"#")+t}function XQ(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Tc=()=>({left:window.pageXOffset,top:window.pageYOffset});function JQ(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=XQ(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Py(e,t){return(history.state?history.state.position-t:-1)+e}const Gf=new Map;function ZQ(e,t){Gf.set(e,t)}function QQ(e){const t=Gf.get(e);return Gf.delete(e),t}let eee=()=>location.protocol+"//"+location.host;function cC(e,t){const{pathname:n,search:o,hash:r}=t,l=e.indexOf("#");if(l>-1){let a=r.includes(e.slice(l))?e.slice(l).length:1,u=r.slice(a);return u[0]!=="/"&&(u="/"+u),My(u,"")}return My(n,e)+o+r}function tee(e,t,n,o){let r=[],l=[],s=null;const a=({state:p})=>{const v=cC(e,location),m=n.value,h=t.value;let g=0;if(p){if(n.value=v,t.value=p,s&&s===m){s=null;return}g=h?p.position-h.position:0}else o(v);r.forEach(y=>{y(n.value,m,{delta:g,type:Da.pop,direction:g?g>0?ta.forward:ta.back:ta.unknown})})};function u(){s=n.value}function c(p){r.push(p);const v=()=>{const m=r.indexOf(p);m>-1&&r.splice(m,1)};return l.push(v),v}function d(){const{history:p}=window;p.state&&p.replaceState(xt({},p.state,{scroll:Tc()}),"")}function f(){for(const p of l)p();l=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",d),{pauseListeners:u,listen:c,destroy:f}}function Ry(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Tc():null}}function nee(e){const{history:t,location:n}=window,o={value:cC(e,n)},r={value:t.state};r.value||l(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(u,c,d){const f=e.indexOf("#"),p=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+u:eee()+e+u;try{t[d?"replaceState":"pushState"](c,"",p),r.value=c}catch(v){console.error(v),n[d?"replace":"assign"](p)}}function s(u,c){const d=xt({},t.state,Ry(r.value.back,u,r.value.forward,!0),c,{position:r.value.position});l(u,d,!0),o.value=u}function a(u,c){const d=xt({},r.value,t.state,{forward:u,scroll:Tc()});l(d.current,d,!0);const f=xt({},Ry(o.value,u,null),{position:d.position+1},c);l(u,f,!1),o.value=u}return{location:o,state:r,push:a,replace:s}}function oee(e){e=qQ(e);const t=nee(e),n=tee(e,t.state,t.location,t.replace);function o(l,s=!0){s||n.pauseListeners(),history.go(l)}const r=xt({location:"",base:e,go:o,createHref:GQ.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function ree(e){return typeof e=="string"||e&&typeof e=="object"}function dC(e){return typeof e=="string"||typeof e=="symbol"}const ur={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},fC=Symbol("");var Ay;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Ay||(Ay={}));function vs(e,t){return xt(new Error,{type:e,[fC]:!0},t)}function Fo(e,t){return e instanceof Error&&fC in e&&(t==null||!!(e.type&t))}const xy="[^/]+?",lee={sensitive:!1,strict:!1,start:!0,end:!0},see=/[.+*?^${}()[\]/\\]/g;function aee(e,t){const n=xt({},lee,t),o=[];let r=n.start?"^":"";const l=[];for(const c of e){const d=c.length?[]:[90];n.strict&&!c.length&&(r+="/");for(let f=0;ft.length?t.length===1&&t[0]===40+40?1:-1:0}function uee(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const cee={type:0,value:""},dee=/[a-zA-Z0-9_]/;function fee(e){if(!e)return[[]];if(e==="/")return[[cee]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${c}": ${v}`)}let n=0,o=n;const r=[];let l;function s(){l&&r.push(l),l=[]}let a=0,u,c="",d="";function f(){c&&(n===0?l.push({type:0,value:c}):n===1||n===2||n===3?(l.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:c,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),c="")}function p(){c+=u}for(;a{s(w)}:ea}function s(d){if(dC(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(s),f.alias.forEach(s))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(s),d.alias.forEach(s))}}function a(){return n}function u(d){let f=0;for(;f=0&&(d.record.path!==n[f].record.path||!pC(d,n[f]));)f++;n.splice(f,0,d),d.record.name&&!By(d)&&o.set(d.record.name,d)}function c(d,f){let p,v={},m,h;if("name"in d&&d.name){if(p=o.get(d.name),!p)throw vs(1,{location:d});h=p.record.name,v=xt(Dy(f.params,p.keys.filter(w=>!w.optional).map(w=>w.name)),d.params&&Dy(d.params,p.keys.map(w=>w.name))),m=p.stringify(v)}else if("path"in d)m=d.path,p=n.find(w=>w.re.test(m)),p&&(v=p.parse(m),h=p.record.name);else{if(p=f.name?o.get(f.name):n.find(w=>w.re.test(f.path)),!p)throw vs(1,{location:d,currentLocation:f});h=p.record.name,v=xt({},f.params,d.params),m=p.stringify(v)}const g=[];let y=p;for(;y;)g.unshift(y.record),y=y.parent;return{name:h,path:m,params:v,matched:g,meta:gee(g)}}return e.forEach(d=>l(d)),{addRoute:l,resolve:c,removeRoute:s,getRoutes:a,getRecordMatcher:r}}function Dy(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function vee(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:mee(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function mee(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="boolean"?n:n[o];return t}function By(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function gee(e){return e.reduce((t,n)=>xt(t,n.meta),{})}function Fy(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function pC(e,t){return t.children.some(n=>n===e||pC(e,n))}const hC=/#/g,yee=/&/g,bee=/\//g,wee=/=/g,_ee=/\?/g,vC=/\+/g,Cee=/%5B/g,See=/%5D/g,mC=/%5E/g,kee=/%60/g,gC=/%7B/g,$ee=/%7C/g,yC=/%7D/g,Eee=/%20/g;function Zh(e){return encodeURI(""+e).replace($ee,"|").replace(Cee,"[").replace(See,"]")}function Tee(e){return Zh(e).replace(gC,"{").replace(yC,"}").replace(mC,"^")}function Xf(e){return Zh(e).replace(vC,"%2B").replace(Eee,"+").replace(hC,"%23").replace(yee,"%26").replace(kee,"`").replace(gC,"{").replace(yC,"}").replace(mC,"^")}function Oee(e){return Xf(e).replace(wee,"%3D")}function Nee(e){return Zh(e).replace(hC,"%23").replace(_ee,"%3F")}function Mee(e){return e==null?"":Nee(e).replace(bee,"%2F")}function Bu(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function Iee(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rl&&Xf(l)):[o&&Xf(o)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+n,l!=null&&(t+="="+l))})}return t}function Pee(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=go(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const Ree=Symbol(""),zy=Symbol(""),Oc=Symbol(""),Qh=Symbol(""),Jf=Symbol("");function Ls(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function mr(e,t,n,o,r){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((s,a)=>{const u=f=>{f===!1?a(vs(4,{from:n,to:t})):f instanceof Error?a(f):ree(f)?a(vs(2,{from:t,to:f})):(l&&o.enterCallbacks[r]===l&&typeof f=="function"&&l.push(f),s())},c=e.call(o&&o.instances[r],t,n,u);let d=Promise.resolve(c);e.length<3&&(d=d.then(u)),d.catch(f=>a(f))})}function vd(e,t,n,o){const r=[];for(const l of e)for(const s in l.components){let a=l.components[s];if(!(t!=="beforeRouteEnter"&&!l.instances[s]))if(Aee(a)){const c=(a.__vccOpts||a)[t];c&&r.push(mr(c,n,o,l,s))}else{let u=a();r.push(()=>u.then(c=>{if(!c)return Promise.reject(new Error(`Couldn't resolve component "${s}" at "${l.path}"`));const d=VQ(c)?c.default:c;l.components[s]=d;const p=(d.__vccOpts||d)[t];return p&&mr(p,n,o,l,s)()}))}}return r}function Aee(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Hy(e){const t=De(Oc),n=De(Qh),o=C(()=>t.resolve(i(e.to))),r=C(()=>{const{matched:u}=o.value,{length:c}=u,d=u[c-1],f=n.matched;if(!d||!f.length)return-1;const p=f.findIndex(hs.bind(null,d));if(p>-1)return p;const v=Ky(u[c-2]);return c>1&&Ky(d)===v&&f[f.length-1].path!==v?f.findIndex(hs.bind(null,u[c-2])):p}),l=C(()=>r.value>-1&&Bee(n.params,o.value.params)),s=C(()=>r.value>-1&&r.value===n.matched.length-1&&uC(n.params,o.value.params));function a(u={}){return Dee(u)?t[i(e.replace)?"replace":"push"](i(e.to)).catch(ea):Promise.resolve()}return{route:o,href:C(()=>o.value.href),isActive:l,isExactActive:s,navigate:a}}const xee=G({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Hy,setup(e,{slots:t}){const n=yt(Hy(e)),{options:o}=De(Oc),r=C(()=>({[jy(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[jy(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const l=t.default&&t.default(n);return e.custom?l:je("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},l)}}}),Lee=xee;function Dee(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Bee(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!go(r)||r.length!==o.length||o.some((l,s)=>l!==r[s]))return!1}return!0}function Ky(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const jy=(e,t,n)=>e??t??n,Fee=G({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=De(Jf),r=C(()=>e.route||o.value),l=De(zy,0),s=C(()=>{let c=i(l);const{matched:d}=r.value;let f;for(;(f=d[c])&&!f.components;)c++;return c}),a=C(()=>r.value.matched[s.value]);ht(zy,C(()=>s.value+1)),ht(Ree,a),ht(Jf,r);const u=N();return me(()=>[u.value,a.value,e.name],([c,d,f],[p,v,m])=>{d&&(d.instances[f]=c,v&&v!==d&&c&&c===p&&(d.leaveGuards.size||(d.leaveGuards=v.leaveGuards),d.updateGuards.size||(d.updateGuards=v.updateGuards))),c&&d&&(!v||!hs(d,v)||!p)&&(d.enterCallbacks[f]||[]).forEach(h=>h(c))},{flush:"post"}),()=>{const c=r.value,d=e.name,f=a.value,p=f&&f.components[d];if(!p)return Wy(n.default,{Component:p,route:c});const v=f.props[d],m=v?v===!0?c.params:typeof v=="function"?v(c):v:null,g=je(p,xt({},m,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(f.instances[d]=null)},ref:u}));return Wy(n.default,{Component:g,route:c})||g}}});function Wy(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Vee=Fee;function zee(e){const t=hee(e.routes,e),n=e.parseQuery||Iee,o=e.stringifyQuery||Vy,r=e.history,l=Ls(),s=Ls(),a=Ls(),u=Pt(ur);let c=ur;Al&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=pd.bind(null,ee=>""+ee),f=pd.bind(null,Mee),p=pd.bind(null,Bu);function v(ee,Z){let te,X;return dC(ee)?(te=t.getRecordMatcher(ee),X=Z):X=ee,t.addRoute(X,te)}function m(ee){const Z=t.getRecordMatcher(ee);Z&&t.removeRoute(Z)}function h(){return t.getRoutes().map(ee=>ee.record)}function g(ee){return!!t.getRecordMatcher(ee)}function y(ee,Z){if(Z=xt({},Z||u.value),typeof ee=="string"){const K=hd(n,ee,Z.path),J=t.resolve({path:K.path},Z),fe=r.createHref(K.fullPath);return xt(K,J,{params:p(J.params),hash:Bu(K.hash),redirectedFrom:void 0,href:fe})}let te;if("path"in ee)te=xt({},ee,{path:hd(n,ee.path,Z.path).path});else{const K=xt({},ee.params);for(const J in K)K[J]==null&&delete K[J];te=xt({},ee,{params:f(ee.params)}),Z.params=f(Z.params)}const X=t.resolve(te,Z),le=ee.hash||"";X.params=d(p(X.params));const de=KQ(o,xt({},ee,{hash:Tee(le),path:X.path})),Ie=r.createHref(de);return xt({fullPath:de,hash:le,query:o===Vy?Pee(ee.query):ee.query||{}},X,{redirectedFrom:void 0,href:Ie})}function w(ee){return typeof ee=="string"?hd(n,ee,u.value.path):xt({},ee)}function b(ee,Z){if(c!==ee)return vs(8,{from:Z,to:ee})}function _(ee){return M(ee)}function k(ee){return _(xt(w(ee),{replace:!0}))}function $(ee){const Z=ee.matched[ee.matched.length-1];if(Z&&Z.redirect){const{redirect:te}=Z;let X=typeof te=="function"?te(ee):te;return typeof X=="string"&&(X=X.includes("?")||X.includes("#")?X=w(X):{path:X},X.params={}),xt({query:ee.query,hash:ee.hash,params:"path"in X?{}:ee.params},X)}}function M(ee,Z){const te=c=y(ee),X=u.value,le=ee.state,de=ee.force,Ie=ee.replace===!0,K=$(te);if(K)return M(xt(w(K),{state:typeof K=="object"?xt({},le,K.state):le,force:de,replace:Ie}),Z||te);const J=te;J.redirectedFrom=Z;let fe;return!de&&jQ(o,X,te)&&(fe=vs(16,{to:J,from:X}),U(X,X,!0,!1)),(fe?Promise.resolve(fe):P(J,X)).catch(ge=>Fo(ge)?Fo(ge,2)?ge:R(ge):T(ge,J,X)).then(ge=>{if(ge){if(Fo(ge,2))return M(xt({replace:Ie},w(ge.to),{state:typeof ge.to=="object"?xt({},le,ge.to.state):le,force:de}),Z||J)}else ge=V(J,X,!0,Ie,le);return A(J,X,ge),ge})}function O(ee,Z){const te=b(ee,Z);return te?Promise.reject(te):Promise.resolve()}function P(ee,Z){let te;const[X,le,de]=Hee(ee,Z);te=vd(X.reverse(),"beforeRouteLeave",ee,Z);for(const K of X)K.leaveGuards.forEach(J=>{te.push(mr(J,ee,Z))});const Ie=O.bind(null,ee,Z);return te.push(Ie),Nl(te).then(()=>{te=[];for(const K of l.list())te.push(mr(K,ee,Z));return te.push(Ie),Nl(te)}).then(()=>{te=vd(le,"beforeRouteUpdate",ee,Z);for(const K of le)K.updateGuards.forEach(J=>{te.push(mr(J,ee,Z))});return te.push(Ie),Nl(te)}).then(()=>{te=[];for(const K of ee.matched)if(K.beforeEnter&&!Z.matched.includes(K))if(go(K.beforeEnter))for(const J of K.beforeEnter)te.push(mr(J,ee,Z));else te.push(mr(K.beforeEnter,ee,Z));return te.push(Ie),Nl(te)}).then(()=>(ee.matched.forEach(K=>K.enterCallbacks={}),te=vd(de,"beforeRouteEnter",ee,Z),te.push(Ie),Nl(te))).then(()=>{te=[];for(const K of s.list())te.push(mr(K,ee,Z));return te.push(Ie),Nl(te)}).catch(K=>Fo(K,8)?K:Promise.reject(K))}function A(ee,Z,te){for(const X of a.list())X(ee,Z,te)}function V(ee,Z,te,X,le){const de=b(ee,Z);if(de)return de;const Ie=Z===ur,K=Al?history.state:{};te&&(X||Ie?r.replace(ee.fullPath,xt({scroll:Ie&&K&&K.scroll},le)):r.push(ee.fullPath,le)),u.value=ee,U(ee,Z,te,Ie),R()}let B;function D(){B||(B=r.listen((ee,Z,te)=>{if(!he.listening)return;const X=y(ee),le=$(X);if(le){M(xt(le,{replace:!0}),X).catch(ea);return}c=X;const de=u.value;Al&&ZQ(Py(de.fullPath,te.delta),Tc()),P(X,de).catch(Ie=>Fo(Ie,12)?Ie:Fo(Ie,2)?(M(Ie.to,X).then(K=>{Fo(K,20)&&!te.delta&&te.type===Da.pop&&r.go(-1,!1)}).catch(ea),Promise.reject()):(te.delta&&r.go(-te.delta,!1),T(Ie,X,de))).then(Ie=>{Ie=Ie||V(X,de,!1),Ie&&(te.delta&&!Fo(Ie,8)?r.go(-te.delta,!1):te.type===Da.pop&&Fo(Ie,20)&&r.go(-1,!1)),A(X,de,Ie)}).catch(ea)}))}let H=Ls(),W=Ls(),F;function T(ee,Z,te){R(ee);const X=W.list();return X.length?X.forEach(le=>le(ee,Z,te)):console.error(ee),Promise.reject(ee)}function L(){return F&&u.value!==ur?Promise.resolve():new Promise((ee,Z)=>{H.add([ee,Z])})}function R(ee){return F||(F=!ee,D(),H.list().forEach(([Z,te])=>ee?te(ee):Z()),H.reset()),ee}function U(ee,Z,te,X){const{scrollBehavior:le}=e;if(!Al||!le)return Promise.resolve();const de=!te&&QQ(Py(ee.fullPath,0))||(X||!te)&&history.state&&history.state.scroll||null;return Ke().then(()=>le(ee,Z,de)).then(Ie=>Ie&&JQ(Ie)).catch(Ie=>T(Ie,ee,Z))}const ne=ee=>r.go(ee);let j;const Q=new Set,he={currentRoute:u,listening:!0,addRoute:v,removeRoute:m,hasRoute:g,getRoutes:h,resolve:y,options:e,push:_,replace:k,go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:l.add,beforeResolve:s.add,afterEach:a.add,onError:W.add,isReady:L,install(ee){const Z=this;ee.component("RouterLink",Lee),ee.component("RouterView",Vee),ee.config.globalProperties.$router=Z,Object.defineProperty(ee.config.globalProperties,"$route",{enumerable:!0,get:()=>i(u)}),Al&&!j&&u.value===ur&&(j=!0,_(r.location).catch(le=>{}));const te={};for(const le in ur)te[le]=C(()=>u.value[le]);ee.provide(Oc,Z),ee.provide(Qh,yt(te)),ee.provide(Jf,u);const X=ee.unmount;Q.add(ee),ee.unmount=function(){Q.delete(ee),Q.size<1&&(c=ur,B&&B(),B=null,u.value=ur,j=!1,F=!1),X()}}};return he}function Nl(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Hee(e,t){const n=[],o=[],r=[],l=Math.max(t.matched.length,e.matched.length);for(let s=0;shs(c,a))?o.push(a):n.push(a));const u=e.matched[s];u&&(t.matched.find(c=>hs(c,u))||r.push(u))}return[n,o,r]}function ri(){return De(Oc)}function Kee(){return De(Qh)}function bC(e,t){return function(){return e.apply(t,arguments)}}const{toString:wC}=Object.prototype,{getPrototypeOf:ev}=Object,tv=(e=>t=>{const n=wC.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),lr=e=>(e=e.toLowerCase(),t=>tv(t)===e),Nc=e=>t=>typeof t===e,{isArray:Es}=Array,Ba=Nc("undefined");function jee(e){return e!==null&&!Ba(e)&&e.constructor!==null&&!Ba(e.constructor)&&Pr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _C=lr("ArrayBuffer");function Wee(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_C(e.buffer),t}const Uee=Nc("string"),Pr=Nc("function"),CC=Nc("number"),nv=e=>e!==null&&typeof e=="object",qee=e=>e===!0||e===!1,iu=e=>{if(tv(e)!=="object")return!1;const t=ev(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Yee=lr("Date"),Gee=lr("File"),Xee=lr("Blob"),Jee=lr("FileList"),Zee=e=>nv(e)&&Pr(e.pipe),Qee=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||wC.call(e)===t||Pr(e.toString)&&e.toString()===t)},ete=lr("URLSearchParams"),tte=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function li(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,r;if(typeof e!="object"&&(e=[e]),Es(e))for(o=0,r=e.length;o0;)if(r=n[o],t===r.toLowerCase())return r;return null}const kC=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),$C=e=>!Ba(e)&&e!==kC;function Zf(){const{caseless:e}=$C(this)&&this||{},t={},n=(o,r)=>{const l=e&&SC(t,r)||r;iu(t[l])&&iu(o)?t[l]=Zf(t[l],o):iu(o)?t[l]=Zf({},o):Es(o)?t[l]=o.slice():t[l]=o};for(let o=0,r=arguments.length;o(li(t,(r,l)=>{n&&Pr(r)?e[l]=bC(r,n):e[l]=r},{allOwnKeys:o}),e),ote=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),rte=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},lte=(e,t,n,o)=>{let r,l,s;const a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),l=r.length;l-- >0;)s=r[l],(!o||o(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&ev(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ste=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},ate=e=>{if(!e)return null;if(Es(e))return e;let t=e.length;if(!CC(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ite=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ev(Uint8Array)),ute=(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=o.next())&&!r.done;){const l=r.value;t.call(e,l[0],l[1])}},cte=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},dte=lr("HTMLFormElement"),fte=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,r){return o.toUpperCase()+r}),Uy=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pte=lr("RegExp"),EC=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};li(n,(r,l)=>{t(r,l,e)!==!1&&(o[l]=r)}),Object.defineProperties(e,o)},hte=e=>{EC(e,(t,n)=>{if(Pr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(Pr(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},vte=(e,t)=>{const n={},o=r=>{r.forEach(l=>{n[l]=!0})};return Es(e)?o(e):o(String(e).split(t)),n},mte=()=>{},gte=(e,t)=>(e=+e,Number.isFinite(e)?e:t),md="abcdefghijklmnopqrstuvwxyz",qy="0123456789",TC={DIGIT:qy,ALPHA:md,ALPHA_DIGIT:md+md.toUpperCase()+qy},yte=(e=16,t=TC.ALPHA_DIGIT)=>{let n="";const{length:o}=t;for(;e--;)n+=t[Math.random()*o|0];return n};function bte(e){return!!(e&&Pr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const wte=e=>{const t=new Array(10),n=(o,r)=>{if(nv(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[r]=o;const l=Es(o)?[]:{};return li(o,(s,a)=>{const u=n(s,r+1);!Ba(u)&&(l[a]=u)}),t[r]=void 0,l}}return o};return n(e,0)},Be={isArray:Es,isArrayBuffer:_C,isBuffer:jee,isFormData:Qee,isArrayBufferView:Wee,isString:Uee,isNumber:CC,isBoolean:qee,isObject:nv,isPlainObject:iu,isUndefined:Ba,isDate:Yee,isFile:Gee,isBlob:Xee,isRegExp:pte,isFunction:Pr,isStream:Zee,isURLSearchParams:ete,isTypedArray:ite,isFileList:Jee,forEach:li,merge:Zf,extend:nte,trim:tte,stripBOM:ote,inherits:rte,toFlatObject:lte,kindOf:tv,kindOfTest:lr,endsWith:ste,toArray:ate,forEachEntry:ute,matchAll:cte,isHTMLForm:dte,hasOwnProperty:Uy,hasOwnProp:Uy,reduceDescriptors:EC,freezeMethods:hte,toObjectSet:vte,toCamelCase:fte,noop:mte,toFiniteNumber:gte,findKey:SC,global:kC,isContextDefined:$C,ALPHABET:TC,generateString:yte,isSpecCompliantForm:bte,toJSONObject:wte};function Mt(e,t,n,o,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),r&&(this.response=r)}Be.inherits(Mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Be.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const OC=Mt.prototype,NC={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{NC[e]={value:e}});Object.defineProperties(Mt,NC);Object.defineProperty(OC,"isAxiosError",{value:!0});Mt.from=(e,t,n,o,r,l)=>{const s=Object.create(OC);return Be.toFlatObject(e,s,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),Mt.call(s,e.message,t,n,o,r),s.cause=e,s.name=e.name,l&&Object.assign(s,l),s};const _te=null;function Qf(e){return Be.isPlainObject(e)||Be.isArray(e)}function MC(e){return Be.endsWith(e,"[]")?e.slice(0,-2):e}function Yy(e,t,n){return e?e.concat(t).map(function(r,l){return r=MC(r),!n&&l?"["+r+"]":r}).join(n?".":""):t}function Cte(e){return Be.isArray(e)&&!e.some(Qf)}const Ste=Be.toFlatObject(Be,{},null,function(t){return/^is[A-Z]/.test(t)});function Mc(e,t,n){if(!Be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,g){return!Be.isUndefined(g[h])});const o=n.metaTokens,r=n.visitor||d,l=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&Be.isSpecCompliantForm(t);if(!Be.isFunction(r))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(Be.isDate(m))return m.toISOString();if(!u&&Be.isBlob(m))throw new Mt("Blob is not supported. Use a Buffer instead.");return Be.isArrayBuffer(m)||Be.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,h,g){let y=m;if(m&&!g&&typeof m=="object"){if(Be.endsWith(h,"{}"))h=o?h:h.slice(0,-2),m=JSON.stringify(m);else if(Be.isArray(m)&&Cte(m)||(Be.isFileList(m)||Be.endsWith(h,"[]"))&&(y=Be.toArray(m)))return h=MC(h),y.forEach(function(b,_){!(Be.isUndefined(b)||b===null)&&t.append(s===!0?Yy([h],_,l):s===null?h:h+"[]",c(b))}),!1}return Qf(m)?!0:(t.append(Yy(g,h,l),c(m)),!1)}const f=[],p=Object.assign(Ste,{defaultVisitor:d,convertValue:c,isVisitable:Qf});function v(m,h){if(!Be.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+h.join("."));f.push(m),Be.forEach(m,function(y,w){(!(Be.isUndefined(y)||y===null)&&r.call(t,y,Be.isString(w)?w.trim():w,h,p))===!0&&v(y,h?h.concat(w):[w])}),f.pop()}}if(!Be.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Gy(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function ov(e,t){this._pairs=[],e&&Mc(e,this,t)}const IC=ov.prototype;IC.append=function(t,n){this._pairs.push([t,n])};IC.toString=function(t){const n=t?function(o){return t.call(this,o,Gy)}:Gy;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function kte(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function PC(e,t,n){if(!t)return e;const o=n&&n.encode||kte,r=n&&n.serialize;let l;if(r?l=r(t,n):l=Be.isURLSearchParams(t)?t.toString():new ov(t,n).toString(o),l){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class $te{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Be.forEach(this.handlers,function(o){o!==null&&t(o)})}}const Xy=$te,RC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ete=typeof URLSearchParams<"u"?URLSearchParams:ov,Tte=typeof FormData<"u"?FormData:null,Ote=typeof Blob<"u"?Blob:null,Nte=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Mte=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),No={isBrowser:!0,classes:{URLSearchParams:Ete,FormData:Tte,Blob:Ote},isStandardBrowserEnv:Nte,isStandardBrowserWebWorkerEnv:Mte,protocols:["http","https","file","blob","url","data"]};function Ite(e,t){return Mc(e,new No.classes.URLSearchParams,Object.assign({visitor:function(n,o,r,l){return No.isNode&&Be.isBuffer(n)?(this.append(o,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)}},t))}function Pte(e){return Be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Rte(e){const t={},n=Object.keys(e);let o;const r=n.length;let l;for(o=0;o=n.length;return s=!s&&Be.isArray(r)?r.length:s,u?(Be.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!a):((!r[s]||!Be.isObject(r[s]))&&(r[s]=[]),t(n,o,r[s],l)&&Be.isArray(r[s])&&(r[s]=Rte(r[s])),!a)}if(Be.isFormData(e)&&Be.isFunction(e.entries)){const n={};return Be.forEachEntry(e,(o,r)=>{t(Pte(o),r,n,0)}),n}return null}const Ate={"Content-Type":void 0};function xte(e,t,n){if(Be.isString(e))try{return(t||JSON.parse)(e),Be.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Ic={transitional:RC,adapter:["xhr","http"],transformRequest:[function(t,n){const o=n.getContentType()||"",r=o.indexOf("application/json")>-1,l=Be.isObject(t);if(l&&Be.isHTMLForm(t)&&(t=new FormData(t)),Be.isFormData(t))return r&&r?JSON.stringify(AC(t)):t;if(Be.isArrayBuffer(t)||Be.isBuffer(t)||Be.isStream(t)||Be.isFile(t)||Be.isBlob(t))return t;if(Be.isArrayBufferView(t))return t.buffer;if(Be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Ite(t,this.formSerializer).toString();if((a=Be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Mc(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return l||r?(n.setContentType("application/json",!1),xte(t)):t}],transformResponse:[function(t){const n=this.transitional||Ic.transitional,o=n&&n.forcedJSONParsing,r=this.responseType==="json";if(t&&Be.isString(t)&&(o&&!this.responseType||r)){const s=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Mt.from(a,Mt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:No.classes.FormData,Blob:No.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Be.forEach(["delete","get","head"],function(t){Ic.headers[t]={}});Be.forEach(["post","put","patch"],function(t){Ic.headers[t]=Be.merge(Ate)});const rv=Ic,Lte=Be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dte=e=>{const t={};let n,o,r;return e&&e.split(`
+`).forEach(function(s){r=s.indexOf(":"),n=s.substring(0,r).trim().toLowerCase(),o=s.substring(r+1).trim(),!(!n||t[n]&&Lte[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},Jy=Symbol("internals");function Ds(e){return e&&String(e).trim().toLowerCase()}function uu(e){return e===!1||e==null?e:Be.isArray(e)?e.map(uu):String(e)}function Bte(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}function Fte(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function gd(e,t,n,o,r){if(Be.isFunction(o))return o.call(this,t,n);if(r&&(t=n),!!Be.isString(t)){if(Be.isString(o))return t.indexOf(o)!==-1;if(Be.isRegExp(o))return o.test(t)}}function Vte(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function zte(e,t){const n=Be.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(r,l,s){return this[o].call(this,t,r,l,s)},configurable:!0})})}class Pc{constructor(t){t&&this.set(t)}set(t,n,o){const r=this;function l(a,u,c){const d=Ds(u);if(!d)throw new Error("header name must be a non-empty string");const f=Be.findKey(r,d);(!f||r[f]===void 0||c===!0||c===void 0&&r[f]!==!1)&&(r[f||u]=uu(a))}const s=(a,u)=>Be.forEach(a,(c,d)=>l(c,d,u));return Be.isPlainObject(t)||t instanceof this.constructor?s(t,n):Be.isString(t)&&(t=t.trim())&&!Fte(t)?s(Dte(t),n):t!=null&&l(n,t,o),this}get(t,n){if(t=Ds(t),t){const o=Be.findKey(this,t);if(o){const r=this[o];if(!n)return r;if(n===!0)return Bte(r);if(Be.isFunction(n))return n.call(this,r,o);if(Be.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ds(t),t){const o=Be.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||gd(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let r=!1;function l(s){if(s=Ds(s),s){const a=Be.findKey(o,s);a&&(!n||gd(o,o[a],a,n))&&(delete o[a],r=!0)}}return Be.isArray(t)?t.forEach(l):l(t),r}clear(t){const n=Object.keys(this);let o=n.length,r=!1;for(;o--;){const l=n[o];(!t||gd(this,this[l],l,t,!0))&&(delete this[l],r=!0)}return r}normalize(t){const n=this,o={};return Be.forEach(this,(r,l)=>{const s=Be.findKey(o,l);if(s){n[s]=uu(r),delete n[l];return}const a=t?Vte(l):String(l).trim();a!==l&&delete n[l],n[a]=uu(r),o[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Be.forEach(this,(o,r)=>{o!=null&&o!==!1&&(n[r]=t&&Be.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
+`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(r=>o.set(r)),o}static accessor(t){const o=(this[Jy]=this[Jy]={accessors:{}}).accessors,r=this.prototype;function l(s){const a=Ds(s);o[a]||(zte(r,s),o[a]=!0)}return Be.isArray(t)?t.forEach(l):l(t),this}}Pc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Be.freezeMethods(Pc.prototype);Be.freezeMethods(Pc);const Yo=Pc;function yd(e,t){const n=this||rv,o=t||n,r=Yo.from(o.headers);let l=o.data;return Be.forEach(e,function(a){l=a.call(n,l,r.normalize(),t?t.status:void 0)}),r.normalize(),l}function xC(e){return!!(e&&e.__CANCEL__)}function si(e,t,n){Mt.call(this,e??"canceled",Mt.ERR_CANCELED,t,n),this.name="CanceledError"}Be.inherits(si,Mt,{__CANCEL__:!0});function Hte(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new Mt("Request failed with status code "+n.status,[Mt.ERR_BAD_REQUEST,Mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Kte=No.isStandardBrowserEnv?function(){return{write:function(n,o,r,l,s,a){const u=[];u.push(n+"="+encodeURIComponent(o)),Be.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),Be.isString(l)&&u.push("path="+l),Be.isString(s)&&u.push("domain="+s),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){const o=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function jte(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Wte(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function LC(e,t){return e&&!jte(t)?Wte(e,t):t}const Ute=No.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let o;function r(l){let s=l;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return o=r(window.location.href),function(s){const a=Be.isString(s)?r(s):s;return a.protocol===o.protocol&&a.host===o.host}}():function(){return function(){return!0}}();function qte(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Yte(e,t){e=e||10;const n=new Array(e),o=new Array(e);let r=0,l=0,s;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),d=o[l];s||(s=c),n[r]=u,o[r]=c;let f=l,p=0;for(;f!==r;)p+=n[f++],f=f%e;if(r=(r+1)%e,r===l&&(l=(l+1)%e),c-s{const l=r.loaded,s=r.lengthComputable?r.total:void 0,a=l-n,u=o(a),c=l<=s;n=l;const d={loaded:l,total:s,progress:s?l/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&c?(s-l)/u:void 0,event:r};d[t?"download":"upload"]=!0,e(d)}}const Gte=typeof XMLHttpRequest<"u",Xte=Gte&&function(e){return new Promise(function(n,o){let r=e.data;const l=Yo.from(e.headers).normalize(),s=e.responseType;let a;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}Be.isFormData(r)&&(No.isStandardBrowserEnv||No.isStandardBrowserWebWorkerEnv)&&l.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const v=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";l.set("Authorization","Basic "+btoa(v+":"+m))}const d=LC(e.baseURL,e.url);c.open(e.method.toUpperCase(),PC(d,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function f(){if(!c)return;const v=Yo.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),h={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:v,config:e,request:c};Hte(function(y){n(y),u()},function(y){o(y),u()},h),c=null}if("onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(f)},c.onabort=function(){c&&(o(new Mt("Request aborted",Mt.ECONNABORTED,e,c)),c=null)},c.onerror=function(){o(new Mt("Network Error",Mt.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let m=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||RC;e.timeoutErrorMessage&&(m=e.timeoutErrorMessage),o(new Mt(m,h.clarifyTimeoutError?Mt.ETIMEDOUT:Mt.ECONNABORTED,e,c)),c=null},No.isStandardBrowserEnv){const v=(e.withCredentials||Ute(d))&&e.xsrfCookieName&&Kte.read(e.xsrfCookieName);v&&l.set(e.xsrfHeaderName,v)}r===void 0&&l.setContentType(null),"setRequestHeader"in c&&Be.forEach(l.toJSON(),function(m,h){c.setRequestHeader(h,m)}),Be.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&s!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Zy(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Zy(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=v=>{c&&(o(!v||v.type?new si(null,e,c):v),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=qte(d);if(p&&No.protocols.indexOf(p)===-1){o(new Mt("Unsupported protocol "+p+":",Mt.ERR_BAD_REQUEST,e));return}c.send(r||null)})},cu={http:_te,xhr:Xte};Be.forEach(cu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Jte={getAdapter:e=>{e=Be.isArray(e)?e:[e];const{length:t}=e;let n,o;for(let r=0;re instanceof Yo?e.toJSON():e;function ms(e,t){t=t||{};const n={};function o(c,d,f){return Be.isPlainObject(c)&&Be.isPlainObject(d)?Be.merge.call({caseless:f},c,d):Be.isPlainObject(d)?Be.merge({},d):Be.isArray(d)?d.slice():d}function r(c,d,f){if(Be.isUndefined(d)){if(!Be.isUndefined(c))return o(void 0,c,f)}else return o(c,d,f)}function l(c,d){if(!Be.isUndefined(d))return o(void 0,d)}function s(c,d){if(Be.isUndefined(d)){if(!Be.isUndefined(c))return o(void 0,c)}else return o(void 0,d)}function a(c,d,f){if(f in t)return o(c,d);if(f in e)return o(void 0,c)}const u={url:l,method:l,data:l,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,d)=>r(e0(c),e0(d),!0)};return Be.forEach(Object.keys(e).concat(Object.keys(t)),function(d){const f=u[d]||r,p=f(e[d],t[d],d);Be.isUndefined(p)&&f!==a||(n[d]=p)}),n}const DC="1.3.4",lv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lv[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const t0={};lv.transitional=function(t,n,o){function r(l,s){return"[Axios v"+DC+"] Transitional option '"+l+"'"+s+(o?". "+o:"")}return(l,s,a)=>{if(t===!1)throw new Mt(r(s," has been removed"+(n?" in "+n:"")),Mt.ERR_DEPRECATED);return n&&!t0[s]&&(t0[s]=!0,console.warn(r(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,s,a):!0}};function Zte(e,t,n){if(typeof e!="object")throw new Mt("options must be an object",Mt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let r=o.length;for(;r-- >0;){const l=o[r],s=t[l];if(s){const a=e[l],u=a===void 0||s(a,l,e);if(u!==!0)throw new Mt("option "+l+" must be "+u,Mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Mt("Unknown option "+l,Mt.ERR_BAD_OPTION)}}const ep={assertOptions:Zte,validators:lv},cr=ep.validators;class Fu{constructor(t){this.defaults=t,this.interceptors={request:new Xy,response:new Xy}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:o,paramsSerializer:r,headers:l}=n;o!==void 0&&ep.assertOptions(o,{silentJSONParsing:cr.transitional(cr.boolean),forcedJSONParsing:cr.transitional(cr.boolean),clarifyTimeoutError:cr.transitional(cr.boolean)},!1),r!==void 0&&ep.assertOptions(r,{encode:cr.function,serialize:cr.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=l&&Be.merge(l.common,l[n.method]),s&&Be.forEach(["delete","get","head","post","put","patch","common"],m=>{delete l[m]}),n.headers=Yo.concat(s,l);const a=[];let u=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(u=u&&h.synchronous,a.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let d,f=0,p;if(!u){const m=[Qy.bind(this),void 0];for(m.unshift.apply(m,a),m.push.apply(m,c),p=m.length,d=Promise.resolve(n);f{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](r);o._listeners=null}),this.promise.then=r=>{let l;const s=new Promise(a=>{o.subscribe(a),l=a}).then(r);return s.cancel=function(){o.unsubscribe(l)},s},t(function(l,s,a){o.reason||(o.reason=new si(l,s,a),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new sv(function(r){t=r}),cancel:t}}}const Qte=sv;function ene(e){return function(n){return e.apply(null,n)}}function tne(e){return Be.isObject(e)&&e.isAxiosError===!0}const tp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tp).forEach(([e,t])=>{tp[t]=e});const nne=tp;function BC(e){const t=new du(e),n=bC(du.prototype.request,t);return Be.extend(n,du.prototype,t,{allOwnKeys:!0}),Be.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return BC(ms(e,r))},n}const rn=BC(rv);rn.Axios=du;rn.CanceledError=si;rn.CancelToken=Qte;rn.isCancel=xC;rn.VERSION=DC;rn.toFormData=Mc;rn.AxiosError=Mt;rn.Cancel=rn.CanceledError;rn.all=function(t){return Promise.all(t)};rn.spread=ene;rn.isAxiosError=tne;rn.mergeConfig=ms;rn.AxiosHeaders=Yo;rn.formToJSON=e=>AC(Be.isHTMLForm(e)?new FormData(e):e);rn.HttpStatusCode=nne;rn.default=rn;const one=rn;let FC;const rne=()=>{FC=lC.service({lock:!0,text:"请求发送中...",background:"rgba(255,255,255,0.5)"})},n0=()=>{FC.close()},lne=e=>new Promise((t,n)=>{const o=one.create({baseURL:"/api",timeout:8e4});o.interceptors.request.use(r=>(rne(),r),r=>{Promise.reject(r)}),o.interceptors.response.use(r=>(n0(),r.data),r=>(n0(),r.response.status==403?Ir.error("请求异常: ",r):Ir.error("服务器繁忙,请稍后再试"),Promise.reject(r))),o(e).then(r=>{t(r)}).catch(r=>{n(r)})}),Ts=(e,t)=>lne({url:e,method:"get",params:t}),sne=e=>(gl("data-v-cc999fca"),e=e(),yl(),e),ane={class:"header"},ine={class:"nav_left"},une=sne(()=>I("a",{href:"/",style:{"font-weight":"600","font-style":"italic","font-size":"24px","margin-right":"5px"}},"Boat",-1)),cne={class:"search_group"},dne={class:"nav_right"},fne=G({__name:"Header",setup(e){const t=N("");ri();const n=()=>{if(t.value.length<=0){Ir.error({message:"请先输入影片名称关键字再进行搜索",duration:1500});return}location.href=`/search?search=${t.value}`},o=yt({cartoon:{},film:{},tv:{},variety:{}});return tt(()=>{Ts("/navCategory").then(r=>{r.status==="ok"?(o.tv=r.data.tv,o.film=r.data.film,o.cartoon=r.data.cartoon,o.variety=r.data.variety):Ir.error({message:"请先输入影片名称关键字再进行搜索",duration:1e3})})}),(r,l)=>{const s=Zt,a=z2,u=ze;return S(),x("div",ane,[I("div",ine,[une,I("div",cne,[et(I("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>t.value=c),placeholder:"搜索 动漫,剧集,电影 ",class:"search"},null,512),[[Ka,t.value]]),z(s,{onClick:n,icon:i(_u)},null,8,["icon"])])]),I("div",dne,[z(a,{underline:!1,href:"/"},{default:q(()=>[nt("首页")]),_:1}),z(a,{underline:!1,href:`/categoryFilm?pid=${o.film.id}`},{default:q(()=>[nt("电影")]),_:1},8,["href"]),z(a,{underline:!1,href:`/categoryFilm?pid=${o.tv.id}`},{default:q(()=>[nt("剧集")]),_:1},8,["href"]),z(a,{underline:!1,href:`/categoryFilm?pid=${o.cartoon.id}`},{default:q(()=>[nt("动漫")]),_:1},8,["href"]),z(a,{underline:!1,href:`/categoryFilm?pid=${o.variety.id}`},{default:q(()=>[nt("综艺")]),_:1},8,["href"]),z(a,{href:"/search",class:"hidden-md-and-up",underline:!1},{default:q(()=>[z(u,{style:{"font-size":"18px"}},{default:q(()=>[z(i(_u))]),_:1})]),_:1})])])}}}),pne=_o(fne,[["__scopeId","data-v-cc999fca"]]),hne={},vne={class:"custom-footer"};function mne(e,t){return S(),x("div",vne," 本站所有内容均来自互联网分享站点所提供的公开引用资源,未提供资源上传、存储服务。 ")}const gne=_o(hne,[["render",mne],["__scopeId","data-v-308cc32e"]]),yne=G({__name:"IndexHome",setup(e){return(t,n)=>{const o=g2,r=Qe("router-view"),l=y2,s=m2,a=v2;return S(),ae(a,null,{default:q(()=>[z(o,null,{default:q(()=>[z(pne)]),_:1}),z(l,null,{default:q(()=>[z(r)]),_:1}),z(s,null,{default:q(()=>[z(gne)]),_:1})]),_:1})}}}),bne=_o(yne,[["__scopeId","data-v-b50482e5"]]),wne=e=>(gl("data-v-d428361f"),e=e(),yl(),e),_ne={class:"container"},Cne={class:"content_item"},Sne=["href"],kne={class:"nav_ul"},$ne={class:"nav_category hidden-md-and-down"},Ene=["href"],Tne=wne(()=>I("li",{class:"hidden-md-and-down"},"更多 >",-1)),One=["href"],Nne={class:"cus_tag hidden-md-and-down"},Mne={class:"cus_tag hidden-md-and-down"},Ine={class:"cus_tag hidden-md-and-down"},Pne=["href"],Rne={class:"cus_remark"},Ane={class:"content_right_item"},xne=["href"],Lne={class:"top_item"},Dne=G({__name:"Home",setup(e){const t=yt({info:{}});return za(()=>{Ts("/index").then(n=>{t.info=n.data})}),(n,o)=>{const r=s2,l=l2;return S(),x("div",_ne,[(S(!0),x(xe,null,lt(t.info.content,s=>(S(),x("div",Cne,[s.nav.name!="综艺"&s.nav.name!="综艺片"?(S(),x(xe,{key:0},[z(l,{class:"row-bg cus_nav",justify:"space-between"},{default:q(()=>[z(r,{span:12,class:"title"},{default:q(()=>[I("span",{class:E(`iconfont ${s.nav.name.search("电影")!=-1?"icon-film":s.nav.name.search("剧")!=-1?"icon-tv":"icon-cartoon"}`),style:{color:"#79bbff","font-size":"32px","margin-right":"10px","line-height":"130%"}},null,2),I("a",{href:`/categoryFilm?pid=${s.nav.id}`},ue(s.nav.name),9,Sne)]),_:2},1024),z(r,{span:12},{default:q(()=>[I("ul",kne,[(S(!0),x(xe,null,lt(s.nav.children,a=>(S(),x("li",$ne,[I("a",{href:`/categoryFilm?pid=${a.pid}&cid=${a.id}`},ue(a.name),9,Ene)]))),256)),Tne])]),_:2},1024)]),_:2},1024),z(l,{class:"cus_content"},{default:q(()=>[z(r,{md:24,lg:20,xl:20,class:"cus_content"},{default:q(()=>[z(l,{style:{"max-width":"100%"}},{default:q(()=>[(S(!0),x(xe,null,lt(s.movies,(a,u)=>(S(),x(xe,null,[u<12?(S(),ae(r,{key:0,md:4,sm:6,xs:8,class:"cus_content_item"},{default:q(()=>[I("a",{href:`/filmDetail?link=${a.id}`,class:"cus_content_link",onError:o[0]||(o[0]=(...c)=>n.handleImgError&&n.handleImgError(...c)),style:He({backgroundImage:`url('${a.picture}')`})},[I("span",Nne,ue(a.year),1),I("span",Mne,ue(a.cName),1),I("span",Ine,ue(a.area),1)],44,One),I("a",{href:`/filmDetail?link=${a.id}`,class:"content_text content_text_tag"},ue(a.name),9,Pne),I("span",Rne,ue(a.remarks),1)]),_:2},1024)):oe("",!0)],64))),256))]),_:2},1024)]),_:2},1024),z(r,{md:0,lg:4,xl:4,class:"hidden-md-and-down content_right"},{default:q(()=>[(S(!0),x(xe,null,lt(s.movies,(a,u)=>(S(),x("div",Ane,[I("a",{href:`/filmDetail?link=${a.id}`},[I("b",Lne,ue(u+1+"."),1),I("span",null,ue(a.name),1)],8,xne)]))),256))]),_:2},1024)]),_:2},1024)],64)):oe("",!0)]))),256))])}}}),Bne=_o(Dne,[["__scopeId","data-v-d428361f"]]),Fne=e=>(gl("data-v-461ae0b0"),e=e(),yl(),e),Vne={class:"container"},zne=Fne(()=>I("h2",{class:"title"},"相关影片",-1)),Hne={class:"content"},Kne={class:"item"},jne=["href"],Wne={class:"cus_tag hidden-md-and-down"},Une={class:"cus_tag hidden-md-and-down"},qne={class:"cus_tag hidden-md-and-down"},Yne={class:"cus_remark hidden-md-and-up"},Gne=["href"],Xne={class:"cus_remark hidden-md-and-down"},Jne=G({__name:"RelateList",props:{relateList:[]},setup(e){return(t,n)=>(S(),x("div",Vne,[zne,I("div",Hne,[(S(!0),x(xe,null,lt(e.relateList,o=>(S(),x("div",Kne,[I("a",{href:`/filmDetail?link=${o.id}`,class:"cus_content_link",style:He({backgroundImage:`url('${o.picture}')`})},[I("span",Wne,ue(o.year),1),I("span",Une,ue(o.cName),1),I("span",qne,ue(o.area),1),I("span",Yne,ue(o.remarks),1)],12,jne),I("a",{href:`/filmDetail?link=${o.id}`,class:"content_text_tag"},ue(o.name),9,Gne),I("span",Xne,ue(o.remarks),1)]))),256))])]))}}),VC=_o(Jne,[["__scopeId","data-v-461ae0b0"]]),Wn=e=>(gl("data-v-43b4caad"),e=e(),yl(),e),Zne={class:"film"},Qne={class:"hidden-sm-and-up"},eoe={class:"title_mt"},toe={class:"title_mt_right"},noe={class:"tags"},ooe={style:{margin:"2px 0"}},roe=Wn(()=>I("span",null,"导演:",-1)),loe=Wn(()=>I("span",null,"主演:",-1)),soe=Wn(()=>I("span",null,"上映:",-1)),aoe=Wn(()=>I("span",null,"地区:",-1)),ioe={key:0},uoe=Wn(()=>I("span",null,"连载:",-1)),coe=Wn(()=>I("span",null,"评分:",-1)),doe={id:"score"},foe={class:"mt_content"},poe=["innerHTML"],hoe={class:"title hidden-sm-and-down"},voe={class:"tags"},moe={class:"t_c"},goe=Wn(()=>I("span",null,"导演:",-1)),yoe=Wn(()=>I("span",null,"主演:",-1)),boe=Wn(()=>I("span",null,"上映:",-1)),woe={key:0},_oe=Wn(()=>I("span",null,"连载:",-1)),Coe=Wn(()=>I("span",null,"评分:",-1)),Soe={id:"score"},koe={class:"cus_wap"},$oe=Wn(()=>I("p",{style:{"min-width":"40px"}},[I("span",null,"剧情:")],-1)),Eoe=["innerHTML"],Toe={class:"play_list"},Ooe=Wn(()=>I("h2",{class:"hidden-md-and-down"},"播放列表:(右侧切换播放源)",-1)),Noe={class:"play_content"},Moe=["onClick"],Ioe={class:"correlation"},Poe=G({__name:"FilmDetails",setup(e){N(!1);const t=ri(),n=yt({detail:{descriptor:{}},relate:[]});tt(()=>{let a=t.currentRoute.value.query.link;Ts("/filmDetail",{id:a}).then(u=>{u.status==="ok"?(n.detail=u.data.detail,n.relate=u.data.relate):Ir({type:"error",dangerouslyUseHTMLString:!0,message:u.message})})});const o=a=>{t.push({path:"/play",query:{id:`${t.currentRoute.value.query.link}`,...a}})},r=N({state:!1,text:"展开"}),l=N(),s=a=>{if(a){r.value={state:!a,text:"展开"},l.value.style.webkitLineClamp=2;return}r.value={state:!a,text:"收起"},l.value.style.webkitLineClamp=8};return(a,u)=>{const c=ze,d=Zt,f=Kh,p=Hh;return S(),x("div",Zne,[I("div",Qne,[I("div",eoe,[I("a",{class:"picture_mt",href:"",style:He({backgroundImage:`url('${n.detail.picture}')`})},null,4),I("div",toe,[I("h3",null,ue(n.detail.name),1),I("ul",noe,[I("li",ooe,ue(`${n.detail.descriptor.classTag}`.replaceAll(","," | ")),1)]),I("p",null,[roe,nt(" "+ue(n.detail.descriptor.director),1)]),I("p",null,[loe,nt(" "+ue(`${n.detail.descriptor.actor}`.split(",")[0]+" "+`${n.detail.descriptor.actor}`.split(",")[1]+" "+`${n.detail.descriptor.actor}`.split(",")[2]),1)]),I("p",null,[soe,nt(" "+ue(n.detail.descriptor.releaseDate),1)]),I("p",null,[aoe,nt(" "+ue(n.detail.descriptor.area),1)]),n.detail.descriptor.remark?(S(),x("p",ioe,[uoe,nt(ue(n.detail.descriptor.remark),1)])):oe("",!0),I("p",null,[coe,I("b",doe,ue(n.detail.descriptor.dbScore),1)])])]),I("div",foe,[I("p",{innerHTML:`${n.detail.descriptor.content}`.replaceAll(" ","")},null,8,poe)])]),I("div",hoe,[I("a",{class:"picture",href:"",style:He({backgroundImage:`url('${n.detail.picture}')`})},null,4),I("h2",null,ue(n.detail.name),1),I("ul",voe,[I("li",moe,[z(c,null,{default:q(()=>[z(i(u1))]),_:1}),nt(" "+ue(n.detail.descriptor.cName),1)]),I("li",null,ue(`${n.detail.descriptor.classTag}`.replaceAll(","," ")),1),I("li",null,ue(n.detail.descriptor.year),1),I("li",null,ue(n.detail.descriptor.area),1)]),I("p",null,[goe,nt(" "+ue(n.detail.descriptor.director),1)]),I("p",null,[yoe,nt(" "+ue(n.detail.descriptor.actor),1)]),I("p",null,[boe,nt(" "+ue(n.detail.descriptor.releaseDate),1)]),n.detail.descriptor.remark?(S(),x("p",woe,[_oe,nt(ue(n.detail.descriptor.remark),1)])):oe("",!0),I("p",null,[Coe,I("b",Soe,ue(n.detail.descriptor.dbScore),1)]),I("div",koe,[$oe,I("p",{ref_key:"textContent",ref:l,class:"text_content"},[`${n.detail.descriptor.content}`.length>120?(S(),ae(d,{key:0,class:"multi_text",style:{color:"#a574b7"},onClick:u[0]||(u[0]=v=>s(r.value.state)),link:""},{default:q(()=>[nt(ue(r.value.text),1)]),_:1})):oe("",!0),I("span",{class:"cus_info",innerHTML:`${n.detail.descriptor.content}`.replaceAll(" ","")},null,8,Eoe)],512)]),I("p",null,[z(d,{type:"warning",class:"player",size:"large",onClick:u[1]||(u[1]=v=>o({episode:0,source:0})),round:""},{default:q(()=>[z(c,null,{default:q(()=>[z(i(sc))]),_:1}),nt(" 立即播放 ")]),_:1})])]),I("div",Toe,[Ooe,z(p,{type:"card",class:"plya_tabs","tab-transition":"fade","tab-animation":"300",lazy:""},{default:q(()=>[(S(!0),x(xe,null,lt(n.detail.playList,(v,m)=>(S(),ae(f,{label:`播放地址${m+1}`},{default:q(()=>[I("div",Noe,[(S(!0),x(xe,null,lt(v,(h,g)=>(S(),x("a",{href:"javascript:;",onClick:y=>o({source:m,episode:g})},ue(h.episode),9,Moe))),256))])]),_:2},1032,["label"]))),256))]),_:1})]),I("div",Ioe,[z(VC,{"relate-list":n.relate},null,8,["relate-list"])])])}}}),Roe=_o(Poe,[["__scopeId","data-v-43b4caad"]]),Aoe=e=>(gl("data-v-5480892d"),e=e(),yl(),e),xoe={class:"player_area"},Loe={class:"player_p"},Doe=["src","name"],Boe={class:"current_play_info"},Foe={class:"play_info_left"},Voe={class:"current_play_title"},zoe={class:"tags"},Hoe={class:"play_list"},Koe=Aoe(()=>I("h2",{class:"hidden-md-and-down"},"播放列表:(右侧切换播放源)",-1)),joe={class:"play_content"},Woe=["onClick"],Uoe={class:"correlation"},qoe=G({__name:"Play",setup(e){const t=yt({detail:{descriptor:{},playList:[[{episode:"",link:""}]]},current:{episode:"",link:""},currentTabName:"",currentPlayFrom:0,currentEpisode:0,relate:[]}),n=ri();tt(()=>{let u=n.currentRoute.value.query;Ts("/filmPlayInfo",{id:u.id,playFrom:u.source,episode:u.episode}).then(c=>{c.status==="ok"&&(t.detail=c.data.detail,c.data.current.link=r(c.data.current.link),t.current=c.data.current,t.currentPlayFrom=c.data.currentPlayFrom,t.currentEpisode=c.data.currentEpisode,t.relate=c.data.relate,t.currentTabName=`tab-${u.source}`)})});const o=["https://jx.jsonplayer.com/player/?url=","http://www.82190555.com/index/qqvod.php?url=","https://vip.bljiex.com/?url=","https://jx.kingtail.xyz/?url=","http://www.82190555.com/index/qqvod.php?url=","https://www.nxflv.com/?url=","http://www.wmxz.wang/video.php?url=","https://www.feisuplayer.com/m3u8/?url=","https://jx.bozrc.com:4433/player/?url=","https://z1.m1907.top/?jx=","https://jx.aidouer.net/?url=","https://www.gai4.com/?url=","https://okjx.cc/?url=","https://jx.rdhk.net/?v=","https://jx.blbo.cc:4433/?url=","https://jsap.attakids.com/?url=","https://jx.dj6u.com/?url="],r=u=>u.search("m3u8")!=-1?`${o[0]+u}`:`${u}`,l=u=>{t.current.link=r(u.link),t.current.episode=u.episode},s=u=>{t.currentTabName=u,t.detail.playList.find((c,d)=>{u.split("-")[1]-d==0&&c.find(f=>{f.episode==t.current.episode&&(t.current.link=r(f.link))})})},a=N();return(u,c)=>{const d=ze,f=Kh,p=Hh;return S(),x("div",xoe,[I("div",Loe,[I("iframe",{ref_key:"iframe",ref:a,class:"player",src:t.current.link,name:t.detail.name,marginheight:"0",marginwidth:"0",framespacing:"0",vspale:"0",frameborder:"0",allowfullscreen:"true",scolling:"no",sandbox:"allow-scripts allow-same-origin allow-downloads"},`\r
+ `,8,Doe)]),I("div",Boe,[I("div",Foe,[I("h3",Voe,ue(`${t.detail.name} ${t.current.episode}`),1),I("div",zoe,[I("b",null,[z(d,null,{default:q(()=>[z(i(u1))]),_:1}),nt(" "+ue(t.detail.descriptor.cName),1)]),I("span",null,ue(t.detail.descriptor.classTag),1),I("span",null,ue(t.detail.descriptor.year),1),I("span",null,ue(t.detail.descriptor.area),1)])])]),I("div",Hoe,[Koe,z(p,{type:"card",modelValue:t.currentTabName,"onUpdate:modelValue":c[0]||(c[0]=v=>t.currentTabName=v),class:"plya_tabs",onTabChange:s},{default:q(()=>[(S(!0),x(xe,null,lt(t.detail.playList,(v,m)=>(S(),ae(f,{name:`tab-${m}`,label:`播放地址${m+1}`},{default:q(()=>[I("div",joe,[(S(!0),x(xe,null,lt(v,(h,g)=>(S(),x("a",{href:"javascript:void(false)",onClick:y=>l(h),class:E(t.current.link.search(h.link)!==-1?"play_active":"")},ue(h.episode),11,Woe))),256))])]),_:2},1032,["name","label"]))),256))]),_:1},8,["modelValue"])]),I("div",Uoe,[z(VC,{"relate-list":t.relate},null,8,["relate-list"])])])}}}),Yoe=_o(qoe,[["__scopeId","data-v-5480892d"]]),av=e=>(gl("data-v-9b0a0870"),e=e(),yl(),e),Goe={class:"container"},Xoe={class:"search_group"},Joe={key:0,class:"search_res"},Zoe={class:"title"},Qoe={class:"content"},ere={class:"film_item"},tre=["href"],nre={class:"film_intro"},ore={class:"tags"},rre={class:"tag_c"},lre=av(()=>I("em",null,"导演:",-1)),sre=av(()=>I("em",null,"主演:",-1)),are={class:"blurb"},ire=av(()=>I("em",null,"剧情:",-1)),ure={class:"pagination_container"},cre=G({__name:"SearchFilm",setup(e){const t=ri(),n=Kee(),o=yt({list:[],page:{current:0},oldSearch:"",search:""});me([n],(u,c)=>{s(t.currentRoute.value.query.search,t.currentRoute.value.query.current)});const r=u=>{location.href=`/play?id=${u}&episode=0&source=0`},l=()=>{if(o.search.length<=0){Ir.error({message:"搜索信息不能为空",duration:1e3});return}location.href=location.href=`/search?search=${o.search}`},s=(u,c)=>{Ts("/searchFilm",{keyword:u,current:c}).then(d=>{o.list=d.data.list,o.page=d.data.page,o.oldSearch=u})};tt(()=>{t.currentRoute.value.query.search!=null&&s(t.currentRoute.value.query.search+"",t.currentRoute.value.query.current)});const a=u=>{let c=t.currentRoute.value.query;location.href=`/search?search=${c.search}¤t=${u}`};return(u,c)=>{const d=Zt,f=Oh,p=Sc;return S(),x(xe,null,[I("div",Goe,[I("div",Xoe,[et(I("input",{"onUpdate:modelValue":c[0]||(c[0]=v=>o.search=v),placeholder:"搜索 动漫,剧集,电影 ",class:"search"},null,512),[[Ka,o.search]]),z(d,{onClick:l,icon:i(_u),style:{}},null,8,["icon"])]),o.list.length>0?(S(),x("div",Joe,[I("div",Zoe,[I("h2",null,ue(o.oldSearch),1),I("p",null,"共找到"+ue(o.page.total)+'部与"'+ue(o.oldSearch)+'"相关的影视作品',1)]),I("div",Qoe,[(S(!0),x(xe,null,lt(o.list,v=>(S(),x("div",ere,[I("a",{href:`/filmDetail?link=${v.id}`,style:He({backgroundImage:`url('${v.picture}')`})},null,12,tre),I("div",nre,[I("h3",null,ue(v.name),1),I("p",ore,[I("span",rre,ue(v.cName),1),I("span",null,ue(v.year),1),I("span",null,ue(v.area),1)]),I("p",null,[lre,nt(ue(v.director),1)]),I("p",null,[sre,nt(ue(v.actor),1)]),I("p",are,[ire,nt(ue(v.blurb.replaceAll(" ","")),1)]),z(d,{icon:i(sc),onClick:m=>r(v.id)},{default:q(()=>[nt("立即播放")]),_:2},1032,["icon","onClick"])])]))),256))]),I("div",ure,[z(f,{background:"",layout:"prev, pager, next","current-page":o.page.current,"onUpdate:currentPage":c[1]||(c[1]=v=>o.page.current=v),onCurrentChange:a,"pager-count":5,"page-size":o.page.pageSize,total:o.page.total,"prev-icon":i(l1),"next-icon":i(s1),"hide-on-single-page":"",class:"pagination"},null,8,["current-page","page-size","total","prev-icon","next-icon"])])])):oe("",!0)]),o.list.length==0?(S(),ae(p,{key:0,description:"输入影片名称进行搜索"})):oe("",!0)],64)}}}),dre=_o(cre,[["__scopeId","data-v-9b0a0870"]]),fre={class:"container"},pre={class:"header"},hre={class:"c_header"},vre=["onClick"],mre={class:"c_content"},gre={class:"item"},yre=["href"],bre={class:"cus_tag"},wre={class:"cus_tag"},_re={class:"cus_tag"},Cre={class:"cus_remark hidden-md-and-up"},Sre=["href"],kre={class:"cus_remark hidden-md-and-down"},$re={class:"pagination_container"},Ere=G({__name:"CategoryFilm",setup(e){const t=yt({category:{},list:[],page:{current:0}}),n=ri(),o=s=>{let a=n.currentRoute.value.query;a.cid&&a.cid!=""?location.href=`/categoryFilm?pid=${a.pid}&cid=${a.cid}¤t=${s}`:location.href=`/categoryFilm?pid=${a.pid}&¤t=${s}`},r=s=>{let a=new URLSearchParams(location.search);location.href=`/categoryFilm?pid=${a.get("pid")}&cid=${s}¤t=1`},l=s=>{Ts("/filmCategory",{pid:s.pid,cid:s.cid,current:s.current}).then(a=>{a.status==="ok"?(t.category=a.data.category,t.list=a.data.list,t.page=a.page):Ir.error({message:"请先输入影片名称关键字再进行搜索",duration:1e3})})};return tt(()=>{let s=n.currentRoute.value.query;l({pid:s.pid,cid:s.cid,current:s.current})}),(s,a)=>{const u=Oh;return S(),x("div",fre,[I("div",pre,[I("p",null,ue(t.category.name),1),I("div",hre,[(S(!0),x(xe,null,lt(t.category.children,c=>(S(),x("a",{class:E(`nav ${t.list.length>0&&t.list[0].cid==c.id?"active":""}`),href:"javascript:;",onClick:d=>r(c.id)},ue(c.name),11,vre))),256))])]),I("div",mre,[(S(!0),x(xe,null,lt(t.list,c=>(S(),x("div",gre,[I("a",{href:`/filmDetail?link=${c.id}`,style:He({backgroundImage:`url('${c.picture}')`})},[I("span",bre,ue(c.year),1),I("span",wre,ue(c.cName),1),I("span",_re,ue(c.area),1),I("span",Cre,ue(c.remarks),1)],12,yre),I("a",{href:`/filmDetail?link=${c.id}`,class:"content_text_tag"},ue(c.name.split("[")[0]),9,Sre),I("span",kre,ue(c.remarks),1)]))),256))]),I("div",$re,[z(u,{background:"",layout:"prev, pager, next","current-page":t.page.current,"onUpdate:currentPage":a[0]||(a[0]=c=>t.page.current=c),onCurrentChange:o,"pager-count":5,"page-size":t.page.pageSize,total:t.page.total,"prev-icon":i(l1),"next-icon":i(s1),"hide-on-single-page":"",class:"pagination"},null,8,["current-page","page-size","total","prev-icon","next-icon"])])])}}}),Tre=_o(Ere,[["__scopeId","data-v-b56e1cfc"]]),Ore={},Nre=e=>(gl("data-v-dc418191"),e=e(),yl(),e),Mre={class:"container"},Ire=Nre(()=>I("p",{style:{"font-size":"32px",width:"100%",color:"#a574b7"}},"你好像走错地方了哦!!!",-1));function Pre(e,t){const n=Sc;return S(),x("div",Mre,[z(n,{style:{height:"100%","line-height":"100%","font-size":"20px"},"image-size":400,image:"/src/assets/image/404.png"},{description:q(()=>[Ire]),_:1})])}const Rre=_o(Ore,[["render",Pre],["__scopeId","data-v-dc418191"]]),Are=[{path:"/",component:bne,redirect:"/index",children:[{path:"index",component:Bne},{path:"filmDetail",component:Roe},{path:"play",component:Yoe},{path:"search",component:dre},{path:"CategoryFilm",component:Tre}]},{path:"/:pathMatch(.*)*",component:Rre}],xre=zee({history:oee(),routes:Are}),iv=hb(FQ);iv.use(AQ);iv.use(xre);iv.mount("#app")});export default Lre();
diff --git a/film/data/nginx/html/assets/play-bb9c8990.png b/film/data/nginx/html/assets/play-bb9c8990.png
new file mode 100644
index 0000000..fc75b28
Binary files /dev/null and b/film/data/nginx/html/assets/play-bb9c8990.png differ
diff --git a/film/data/nginx/html/index.html b/film/data/nginx/html/index.html
new file mode 100644
index 0000000..aa2b06e
--- /dev/null
+++ b/film/data/nginx/html/index.html
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+ (╥﹏╥)
+
+
+
+
+
+
+
+
+
diff --git a/film/data/nginx/html/vite.svg b/film/data/nginx/html/vite.svg
new file mode 100644
index 0000000..e7b8dfb
--- /dev/null
+++ b/film/data/nginx/html/vite.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/film/data/nginx/nginx.conf b/film/data/nginx/nginx.conf
new file mode 100644
index 0000000..d37d55d
--- /dev/null
+++ b/film/data/nginx/nginx.conf
@@ -0,0 +1,28 @@
+#user root;
+worker_processes 1;
+events {
+ worker_connections 1024;
+}
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ sendfile on;
+ keepalive_timeout 65;
+ server {
+ listen 80;
+ server_name localhost;
+ location / {
+ root /usr/share/nginx/html;
+ try_files $uri $uri/ /index.html last;
+ index index.html index.htm;
+ }
+ #跨域配置
+ location /api/{
+ proxy_pass http://film:3601/;
+ }
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root html;
+ }
+ }
+}
\ No newline at end of file
diff --git a/film/data/redis/redis.conf b/film/data/redis/redis.conf
new file mode 100644
index 0000000..2f7254a
--- /dev/null
+++ b/film/data/redis/redis.conf
@@ -0,0 +1,5 @@
+#bind 127.0.0.1
+daemonize no
+requirepass root
+appendonly yes
+tcp-keepalive 300
\ No newline at end of file
diff --git a/film/docker-compose.yml b/film/docker-compose.yml
new file mode 100644
index 0000000..51c394d
--- /dev/null
+++ b/film/docker-compose.yml
@@ -0,0 +1,72 @@
+version: '3.8'
+
+services:
+ nginx:
+ container_name: film_nginx
+ image: nginx
+ ports:
+ - "3600:80"
+ volumes:
+ - /opt/film/data/nginx/html:/usr/share/nginx/html
+ - /opt/film/data/nginx/nginx.conf:/etc/nginx/nginx.conf
+ networks:
+ - film-network
+ depends_on:
+ - film
+
+ film:
+ container_name: film_api
+ build:
+ context: .
+ dockerfile: Dockerfile
+ environment:
+ MYSQL_HOST: mysql
+ MYSQL_PORT: 3661
+ MYSQL_USER: root
+ MYSQL_PASSWORD: root
+ MYSQL_DBNAME: FilmSite
+ REDIS_HOST: redis
+ REDIS_PORT: 3662
+ ports:
+ - "3601:3601"
+ networks:
+ - film-network
+ depends_on:
+ - mysql
+ - redis
+ command: [
+ './main',
+ ]
+
+ mysql:
+ container_name: film_mysql
+ image: mysql
+ ports:
+ - 3610:3306
+ environment:
+ MYSQL_ROOT_PASSWORD: root
+ MYSQL_DATABASE: FilmSite
+ networks:
+ - film-network
+ command: [
+ 'mysqld',
+ '--default-authentication-plugin=mysql_native_password',
+ '--innodb-buffer-pool-size=80M',
+ '--character-set-server=utf8mb4',
+ '--collation-server=utf8mb4_unicode_ci',
+ '--default-time-zone=+8:00',
+ '--lower-case-table-names=1'
+ ]
+
+ redis:
+ container_name: film_redis
+ image: redis
+ ports:
+ - 3620:6379
+ volumes:
+ - /opt/film/data/redis/redis.conf:/usr/local/etc/redis/redis.conf
+ networks:
+ - film-network
+networks:
+ film-network:
+ driver: bridge
\ No newline at end of file
diff --git a/film/server/.idea/.gitignore b/film/server/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/film/server/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/film/server/.idea/modules.xml b/film/server/.idea/modules.xml
new file mode 100644
index 0000000..fbd90b4
--- /dev/null
+++ b/film/server/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/film/server/.idea/server.iml b/film/server/.idea/server.iml
new file mode 100644
index 0000000..5e764c4
--- /dev/null
+++ b/film/server/.idea/server.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/film/server/README.md b/film/server/README.md
new file mode 100644
index 0000000..f6da4f6
--- /dev/null
+++ b/film/server/README.md
@@ -0,0 +1,83 @@
+# Film Server
+
+## 简介
+
+- server 是本项目的后端项目
+- 主要用于提供前端项目需要的 API数据接口, 以及数据搜集和更新
+- 实现思路 :
+ - 使用 gocolly 获取公开的影视资源,
+ - 将请求数据通过程序处理整合成统一格式后使用redis进行暂存
+ - 使用 mysql 存储收录的影片的检索信息, 用于影片检索, 分类
+ - 使用 gin 作为web服务, 提供相应api接口
+- 项目依赖
+
+```go
+# gin web服务框架, 用于处理与前端工程的交互
+github.com/gin-gonic/gin v1.9.0
+# gocolly go语言爬虫框架, 用于搜集公共影视资源
+github.com/gocolly/colly/v2 v2.1.0
+# go-redis redis交互程序
+github.com/redis/go-redis/v9 v9.0.2
+# gorm 用于处理与mysql数据库的交互
+gorm.io/gorm v1.24.6
+gorm.io/driver/mysql v1.4.7
+```
+
+
+
+## 项目结构
+
+> 项目主要目录结构
+
+- config 用于存放项目中使用的配置信息和静态常量
+- controller 请求处理控制器
+- logic 请求处理逻辑实现
+- model 数据模型结构体以及与数据库交互
+- plugin 项目所需的插件工具集合
+ - common 公共依赖
+ - db 数据库配置信息
+ - spider gocolly配置, 执行逻辑, 数据前置处理等
+
+```text
+server
+├─ config
+│ └─ DataConfig.go
+├─ controller
+│ ├─ IndexController.go
+│ └─ SpiderController.go
+├─ logic
+│ └─ IndexLogic.go
+├─ model
+│ ├─ Categories.go
+│ ├─ LZJson.go
+│ ├─ Movies.go
+│ └─ Search.go
+├─ plugin
+│ ├─ common
+│ │ ├─ JsonUtils.go
+│ │ ├─ ProcessCategory.go
+│ │ └─ ProcessMovies.go
+│ ├─ db
+│ │ ├─ mysql.go
+│ │ └─ redis.go
+│ └─ spider
+│ ├─ Spider.go
+│ ├─ SpiderCron.go
+│ └─ SpiderRequest.go
+├─ router
+│ └─ router.go
+├─ go.mod
+├─ go.sum
+├─ main.go
+└─ README.md
+```
+
+
+
+## 启动方式
+
+### 本地运行
+
+1. 修改 /server/plugin/db 目录下的 mysql.go 和 redis.go 中的连接地址和用户名密码
+2. 在 server 目录下执行 `go run main.go`
+
diff --git a/film/server/config/DataConfig.go b/film/server/config/DataConfig.go
new file mode 100644
index 0000000..f7cd47e
--- /dev/null
+++ b/film/server/config/DataConfig.go
@@ -0,0 +1,50 @@
+package config
+
+import "time"
+
+/*
+定义一些数据库存放的key值
+*/
+const (
+
+ // CategoryTreeKey 分类树 key
+ CategoryTreeKey = "CategoryTree"
+ CategoryTreeExpired = time.Hour * 24 * 90
+ // MovieListInfoKey movies分类列表 key
+ MovieListInfoKey = "MovieList:Cid%d"
+ // MAXGoroutine max goroutine, 执行spider中对协程的数量限制
+ MAXGoroutine = 6
+ // MovieDetailKey movie detail影视详情信息 可以
+ MovieDetailKey = "MovieDetail:Cid%d:Id%d"
+ // MovieBasicInfoKey 影片基本信息, 简略版本
+ MovieBasicInfoKey = "MovieBasicInfoKey:Cid%d:Id%d"
+
+ // SearchCount Search scan 识别范围
+ SearchCount = 3000
+ // SearchKeys Search Key Hash
+ SearchKeys = "SearchKeys"
+ // SearchScoreListKey 根据评分检索的key
+ SearchScoreListKey = "Search:SearchScoreList"
+ SearchTimeListKey = "Search:SearchTimeList"
+ SearchHeatListKey = "Search:SearchHeatList"
+ // SearchInfoTemp redis暂存检索数据信息
+ SearchInfoTemp = "Search:SearchInfoTemp"
+
+ // CornMovieUpdate 影片更新定时任务间隔
+ CornMovieUpdate = "0 0/20 * * * ?"
+ // UpdateInterval 获取最近几小时更新的影片 (h 小时) 默认3小时
+ UpdateInterval = "3"
+ // CornUpdateAll 每月28执行一次清库更新
+ CornUpdateAll = "0 0 2 28 * ?"
+
+ // SpiderCipher 设置Spider触发指令
+ SpiderCipher = "Life in a different world from zero"
+)
+
+const (
+ MysqlDsn = "root:root@(mysql:3306)/FilmSite?charset=utf8mb4&parseTime=True&loc=Local"
+
+ RedisAddr = `redis:6379`
+ RedisPassword = `root`
+ RedisDBNo = 0
+)
diff --git a/film/server/controller/IndexController.go b/film/server/controller/IndexController.go
new file mode 100644
index 0000000..5c49a56
--- /dev/null
+++ b/film/server/controller/IndexController.go
@@ -0,0 +1,160 @@
+package controller
+
+import (
+ "github.com/gin-gonic/gin"
+ "net/http"
+ "server/logic"
+ "server/model"
+ "strconv"
+ "strings"
+)
+
+const (
+ StatusOk = "ok"
+ StatusFailed = "failed"
+)
+
+// Index 首页数据
+func Index(c *gin.Context) {
+ // 获取首页所需数据
+ data := logic.IL.IndexPage()
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": data,
+ })
+}
+
+// CategoriesInfo 分类信息获取
+func CategoriesInfo(c *gin.Context) {
+ data := logic.IL.GetCategoryInfo()
+
+ if data == nil {
+ c.JSON(http.StatusOK, gin.H{
+ `status`: StatusFailed,
+ `message`: `暂无分类信息!!!`,
+ })
+ return
+ }
+ c.JSON(http.StatusOK, gin.H{
+ `status`: StatusOk,
+ `data`: data,
+ })
+}
+
+// FilmDetail 影片详情信息查询
+func FilmDetail(c *gin.Context) {
+ // 获取请求参数
+ id, err := strconv.Atoi(c.Query("id"))
+ if err != nil {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "请求异常,暂无影片信息!!!",
+ })
+ return
+ }
+ // 获取影片详情信息
+ detail := logic.IL.GetFilmDetail(id)
+ // 获取相关推荐影片数据
+ page := model.Page{Current: 0, PageSize: 14}
+ relateMovie := logic.IL.RelateMovie(detail, &page)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "detail": detail,
+ "relate": relateMovie,
+ },
+ })
+}
+
+// FilmPlayInfo 影视播放页数据
+func FilmPlayInfo(c *gin.Context) {
+ // 获取请求参数
+ id, err := strconv.Atoi(c.DefaultQuery("id", "0"))
+ playFrom, err := strconv.Atoi(c.DefaultQuery("playFrom", "0"))
+ episode, err := strconv.Atoi(c.DefaultQuery("episode", "0"))
+ if err != nil {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "请求异常,暂无影片信息!!!",
+ })
+ return
+ }
+ // 获取影片详情信息
+ detail := logic.IL.GetFilmDetail(id)
+ // 推荐影片信息
+ page := model.Page{Current: 0, PageSize: 14}
+ relateMovie := logic.IL.RelateMovie(detail, &page)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "detail": detail,
+ "current": detail.PlayList[playFrom][episode],
+ "currentPlayFrom": playFrom,
+ "currentEpisode": episode,
+ "relate": relateMovie,
+ },
+ })
+}
+
+// SearchFilm 通过片名模糊匹配库存中的信息
+func SearchFilm(c *gin.Context) {
+ keyword := c.DefaultQuery("keyword", "")
+ currStr := c.DefaultQuery("current", "1")
+ current, _ := strconv.Atoi(currStr)
+ page := model.Page{PageSize: 10, Current: current}
+ bl := logic.IL.SearchFilmInfo(strings.TrimSpace(keyword), &page)
+
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": bl,
+ "page": page,
+ },
+ })
+}
+
+// FilmCategory 获取指定分类的影片分页数据,
+func FilmCategory(c *gin.Context) {
+ // 1.1 首先获取Cid 二级分类id是否存在
+ cidStr := c.DefaultQuery("cid", "")
+ // 1.2 如果pid也不存在直接返回错误信息
+ pidStr := c.DefaultQuery("pid", "")
+ if pidStr == "" {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "缺少分类信息",
+ })
+ return
+ }
+ // 1.3 获取pid对应的分类信息
+ pid, _ := strconv.ParseInt(pidStr, 10, 64)
+ category := logic.IL.GetPidCategory(pid)
+
+ // 2 设置分页信息
+ currentStr := c.DefaultQuery("current", "1")
+ current, _ := strconv.Atoi(currentStr)
+ page := model.Page{PageSize: 49, Current: current}
+ // 2.1 如果不存在cid则根据Pid进行查询
+ if cidStr == "" {
+ // 2.2 如果存在pid则根据pid进行查找
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": logic.IL.GetFilmCategory(pid, "pid", &page),
+ "category": category,
+ },
+ "page": page,
+ })
+ return
+ }
+ // 2.2 如果存在cid 则根据具体的cid去查询数据
+ cid, _ := strconv.ParseInt(cidStr, 10, 64)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": logic.IL.GetFilmCategory(cid, "cid", &page),
+ "category": category,
+ },
+ "page": page,
+ })
+}
diff --git a/film/server/controller/SpiderController.go b/film/server/controller/SpiderController.go
new file mode 100644
index 0000000..a232c52
--- /dev/null
+++ b/film/server/controller/SpiderController.go
@@ -0,0 +1,46 @@
+package controller
+
+import (
+ "github.com/gin-gonic/gin"
+ "log"
+ "net/http"
+ "server/config"
+ "server/model"
+ "server/plugin/spider"
+)
+
+// SpiderRe 数据清零重开
+func SpiderRe(c *gin.Context) {
+ // 获取指令参数
+ cip := c.Query("cipher")
+ if cip != config.SpiderCipher {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "指令错误无法进行此操作",
+ })
+ return
+ }
+ // 如果指令正确,则执行重制
+ spider.StartSpiderRe()
+}
+
+// FixFilmDetail 修复因网络异常造成的影片详情数据丢失
+func FixFilmDetail(c *gin.Context) {
+ // 获取指令参数
+ cip := c.Query("cipher")
+ if cip != config.SpiderCipher {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "指令错误无法进行此操作",
+ })
+ return
+ }
+ // 如果指令正确,则执行详情数据获取
+ spider.AllMovieInfo()
+ log.Println("FilmDetail 重制完成!!!")
+ // 先截断表中的数据
+ model.TunCateSearchTable()
+ // 重新扫描完整的信息到mysql中
+ spider.SearchInfoToMdb()
+ log.Println("SearchInfo 重制完成!!!")
+}
diff --git a/film/server/go.mod b/film/server/go.mod
new file mode 100644
index 0000000..ead662b
--- /dev/null
+++ b/film/server/go.mod
@@ -0,0 +1,55 @@
+module server
+
+go 1.20
+
+require (
+ github.com/gin-gonic/gin v1.9.0
+ github.com/gocolly/colly/v2 v2.1.0
+ github.com/redis/go-redis/v9 v9.0.2
+ github.com/robfig/cron/v3 v3.0.0
+ gorm.io/driver/mysql v1.4.7
+ gorm.io/gorm v1.24.6
+)
+
+require (
+ github.com/PuerkitoBio/goquery v1.5.1 // indirect
+ github.com/andybalholm/cascadia v1.2.0 // indirect
+ github.com/antchfx/htmlquery v1.2.3 // indirect
+ github.com/antchfx/xmlquery v1.2.4 // indirect
+ github.com/antchfx/xpath v1.1.8 // indirect
+ github.com/bytedance/sonic v1.8.5 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
+ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+ github.com/gin-contrib/sse v0.1.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.12.0 // indirect
+ github.com/go-sql-driver/mysql v1.7.0 // indirect
+ github.com/gobwas/glob v0.2.3 // indirect
+ github.com/goccy/go-json v0.10.2 // indirect
+ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
+ github.com/golang/protobuf v1.5.0 // indirect
+ github.com/jinzhu/inflection v1.0.0 // indirect
+ github.com/jinzhu/now v1.1.5 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/kennygrant/sanitize v1.2.4 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.4 // indirect
+ github.com/leodido/go-urn v1.2.2 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.7 // indirect
+ github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
+ github.com/temoto/robotstxt v1.1.1 // indirect
+ github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+ github.com/ugorji/go/codec v1.2.11 // indirect
+ golang.org/x/arch v0.3.0 // indirect
+ golang.org/x/crypto v0.7.0 // indirect
+ golang.org/x/net v0.8.0 // indirect
+ golang.org/x/sys v0.6.0 // indirect
+ golang.org/x/text v0.8.0 // indirect
+ google.golang.org/appengine v1.6.6 // indirect
+ google.golang.org/protobuf v1.30.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/film/server/go.sum b/film/server/go.sum
new file mode 100644
index 0000000..ade6084
--- /dev/null
+++ b/film/server/go.sum
@@ -0,0 +1,209 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
+github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
+github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
+github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
+github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
+github.com/antchfx/htmlquery v1.2.3 h1:sP3NFDneHx2stfNXCKbhHFo8XgNjCACnU/4AO5gWz6M=
+github.com/antchfx/htmlquery v1.2.3/go.mod h1:B0ABL+F5irhhMWg54ymEZinzMSi0Kt3I2if0BLYa3V0=
+github.com/antchfx/xmlquery v1.2.4 h1:T/SH1bYdzdjTMoz2RgsfVKbM5uWh3gjDYYepFqQmFv4=
+github.com/antchfx/xmlquery v1.2.4/go.mod h1:KQQuESaxSlqugE2ZBcM/qn+ebIpt+d+4Xx7YcSGAIrM=
+github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
+github.com/antchfx/xpath v1.1.8 h1:PcL6bIX42Px5usSx6xRYw/wjB3wYGkj0MJ9MBzEKVgk=
+github.com/antchfx/xpath v1.1.8/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
+github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ=
+github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8=
+github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
+github.com/bytedance/sonic v1.8.5 h1:kjX0/vo5acEQ/sinD/18SkA/lDDUk23F0RcaHvI7omc=
+github.com/bytedance/sonic v1.8.5/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
+github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
+github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
+github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
+github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI=
+github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA=
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
+github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA=
+github.com/gocolly/colly/v2 v2.1.0 h1:k0DuZkDoCsx51bKpRJNEmcxcp+W5N8ziuwGaSDuFoGs=
+github.com/gocolly/colly/v2 v2.1.0/go.mod h1:I2MuhsLjQ+Ex+IzK3afNS8/1qP3AedHOusRPcRdC5o0=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
+github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
+github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
+github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
+github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
+github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
+github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
+github.com/leodido/go-urn v1.2.2 h1:7z68G0FCGvDk646jz1AelTYNYWrTNm0bEcFAo147wt4=
+github.com/leodido/go-urn v1.2.2/go.mod h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
+github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE=
+github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps=
+github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
+github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
+github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ=
+github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
+github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=
+github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
+github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
+github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
+github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
+github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
+golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
+golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
+golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
+golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
+google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
+gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
+gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
+gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s=
+gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
diff --git a/film/server/logic/IndexLogic.go b/film/server/logic/IndexLogic.go
new file mode 100644
index 0000000..ea04db5
--- /dev/null
+++ b/film/server/logic/IndexLogic.go
@@ -0,0 +1,137 @@
+package logic
+
+import (
+ "fmt"
+ "github.com/gin-gonic/gin"
+ "server/config"
+ "server/model"
+ "server/plugin/db"
+)
+
+/*
+*
+ IndexController数据处理
+*/
+
+type IndexLogic struct {
+}
+
+var IL *IndexLogic
+
+// IndexPage 首页数据处理
+func (i *IndexLogic) IndexPage() gin.H {
+ Info := gin.H{}
+ // 首页分类数据处理
+
+ // 1. 导航分类数据处理, 只提供 电影 电视剧 综艺 动漫 四大顶级分类和其子分类
+ tree := model.CategoryTree{Category: &model.Category{Id: 0, Name: "分类信息"}}
+ sysTree := model.GetCategoryTree()
+ // 由于采集源数据格式不一,因此采用名称匹配
+ for _, c := range sysTree.Children {
+ switch c.Category.Name {
+ case "电影", "电影片", "连续剧", "电视剧", "综艺", "综艺片", "动漫", "动漫片":
+ tree.Children = append(tree.Children, c)
+ }
+ }
+ Info["category"] = tree
+ // 2. 提供用于首页展示的顶级分类影片信息, 每分类 14条数据
+ var list []gin.H
+ for _, c := range tree.Children {
+ page := model.Page{PageSize: 14, Current: 1}
+ movies := model.GetMovieListByPid(c.Id, &page)
+ item := gin.H{"nav": c, "movies": movies}
+ list = append(list, item)
+ }
+ Info["content"] = list
+
+ return Info
+}
+
+// GetFilmDetail 影片详情信息页面处理
+func (i *IndexLogic) GetFilmDetail(id int) model.MovieDetail {
+ // 通过Id 获取影片search信息
+ search := model.SearchInfo{}
+ db.Mdb.Where("mid", id).First(&search)
+ // 获取redis中的完整影视信息 MovieDetail:Cid11:Id24676
+ movieDetail := model.GetDetailByKey(fmt.Sprintf(config.MovieDetailKey, search.Cid, search.Mid))
+ return movieDetail
+}
+
+// GetCategoryInfo 分类信息获取, 组装导航栏需要的信息
+func (i *IndexLogic) GetCategoryInfo() gin.H {
+ // 组装nav导航所需的信息
+ nav := gin.H{}
+ // 1.获取所有分类信息
+ tree := model.GetCategoryTree()
+ // 2. 过滤出主页四大分类的tree信息
+ for _, t := range tree.Children {
+ switch t.Category.Name {
+ case "动漫", "动漫片":
+ nav["cartoon"] = t
+ case "电影", "电影片":
+ nav["film"] = t
+ case "连续剧", "电视剧":
+ nav["tv"] = t
+ case "综艺", "综艺片":
+ nav["variety"] = t
+ }
+ }
+ // 获取所有的分类
+ return nav
+}
+
+// SearchFilmInfo 获取关键字匹配的影片信息
+func (i *IndexLogic) SearchFilmInfo(key string, page *model.Page) []model.MovieBasicInfo {
+ // 1. 从mysql中获取满足条件的数据, 每页10条
+ sl := model.SearchFilmKeyword(key, page)
+ // 2. 获取redis中的basicMovieInfo信息
+ var bl []model.MovieBasicInfo
+ for _, s := range sl {
+ bl = append(bl, model.GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, s.Cid, s.Mid)))
+ }
+ return bl
+}
+
+// GetFilmCategory 根据Pid或Cid获取指定的分页数据
+func (i *IndexLogic) GetFilmCategory(id int64, idType string, page *model.Page) []model.MovieBasicInfo {
+ // 1. 根据不同类型进不同的查找
+ var basicList []model.MovieBasicInfo
+ switch idType {
+ case "pid":
+ basicList = model.GetMovieListByPid(id, page)
+ case "cid":
+ basicList = model.GetMovieListByCid(id, page)
+ }
+ return basicList
+}
+
+// GetPidCategory 获取pid对应的分类信息
+func (i *IndexLogic) GetPidCategory(pid int64) *model.CategoryTree {
+ tree := model.GetCategoryTree()
+ for _, t := range tree.Children {
+ if t.Id == pid {
+ return t
+ }
+ }
+ return nil
+}
+
+// RelateMovie 根据当前影片信息匹配相关的影片
+func (i *IndexLogic) RelateMovie(detail model.MovieDetail, page *model.Page) []model.MovieBasicInfo {
+ /*
+ 根据当前影片信息匹配相关的影片
+ 1. 分类Cid,
+ 2. 影片名Name
+ 3. 剧情内容标签class_tag
+ 4. 地区 area
+ 5. 语言 Language
+ */
+ search := model.SearchInfo{
+ Cid: detail.Cid,
+ Name: detail.Name,
+ ClassTag: detail.ClassTag,
+ Area: detail.Area,
+ Language: detail.Language,
+ }
+ return model.GetRelateMovieBasicInfo(search, page)
+}
diff --git a/film/server/main.go b/film/server/main.go
new file mode 100644
index 0000000..d233cb5
--- /dev/null
+++ b/film/server/main.go
@@ -0,0 +1,47 @@
+package main
+
+import (
+ "server/model"
+ "server/plugin/db"
+ "server/plugin/spider"
+ "server/router"
+ "time"
+)
+
+func init() {
+ // 执行初始化前等待30s , 让mysql服务完成初始化指令
+ time.Sleep(time.Second * 30)
+ //初始化redis客户端
+ err := db.InitRedisConn()
+ if err != nil {
+ panic(err)
+ }
+ // 初始化mysql
+ err = db.InitMysql()
+ if err != nil {
+ panic(err)
+ }
+}
+func main() {
+ start()
+}
+
+func start() {
+ // 开启前先判断是否需要执行Spider
+ ExecSpider()
+ // web服务启动后开启定时任务, 用于定期更新资源
+ spider.RegularUpdateMovie()
+ // 开启路由监听
+ r := router.SetupRouter()
+ _ = r.Run(`:3601`)
+
+}
+
+func ExecSpider() {
+ // 判断分类信息是否存在
+ isStart := model.ExistsCategoryTree()
+ // 如果分类信息不存在则进行一次完整爬取
+ if !isStart {
+ spider.StartSpider()
+ }
+}
diff --git a/film/server/model/Categories.go b/film/server/model/Categories.go
new file mode 100644
index 0000000..87f837f
--- /dev/null
+++ b/film/server/model/Categories.go
@@ -0,0 +1,43 @@
+package model
+
+import (
+ "encoding/json"
+ "log"
+ "server/config"
+ "server/plugin/db"
+)
+
+// Category 分类信息
+type Category struct {
+ Id int64 `json:"id"` // 分类ID
+ Pid int64 `json:"pid"` // 父级分类ID
+ Name string `json:"name"` // 分类名称
+}
+
+// CategoryTree 分类信息树形结构
+type CategoryTree struct {
+ *Category
+ Children []*CategoryTree `json:"children"` // 子分类信息
+}
+
+// SaveCategoryTree 保存影片分类信息
+func SaveCategoryTree(tree string) error {
+ return db.Rdb.Set(db.Cxt, config.CategoryTreeKey, tree, config.CategoryTreeExpired).Err()
+}
+
+// GetCategoryTree 获取影片分类信息
+func GetCategoryTree() CategoryTree {
+ data := db.Rdb.Get(db.Cxt, config.CategoryTreeKey).Val()
+ tree := CategoryTree{}
+ _ = json.Unmarshal([]byte(data), &tree)
+ return tree
+}
+
+// ExistsCategoryTree 查询分类信息是否存在
+func ExistsCategoryTree() bool {
+ exists, err := db.Rdb.Exists(db.Cxt, config.CategoryTreeKey).Result()
+ if err != nil {
+ log.Println("ExistsCategoryTree Error", err)
+ }
+ return exists == 1
+}
diff --git a/film/server/model/LZJson.go b/film/server/model/LZJson.go
new file mode 100644
index 0000000..e0b1a18
--- /dev/null
+++ b/film/server/model/LZJson.go
@@ -0,0 +1,81 @@
+package model
+
+/*
+量子资源JSON解析
+*/
+
+// ClassInfo class 分类数据
+type ClassInfo struct {
+ Id int64 `json:"type_id"` //分类ID
+ Pid int64 `json:"type_pid"` //上级分类ID
+ Name string `json:"type_name"` //分类名称
+}
+
+// MovieInfo 影片数据
+type MovieInfo struct {
+ Id int64 `json:"vod_id"` // 影片ID
+ Name string `json:"vod_name"` // 影片名
+ Cid int64 `json:"type_id"` // 所属分类ID
+ CName string `json:"type_name"` // 所属分类名称
+ EnName string `json:"vod_en"` // 英文片名
+ Time string `json:"vod_time"` // 更新时间
+ Remarks string `json:"vod_remarks"` // 备注 | 清晰度
+ PlayFrom string `json:"vod_play_from"` // 播放来源
+}
+
+// MovieListInfo 影视列表响应数据
+type MovieListInfo struct {
+ Code int64 `json:"code"`
+ Msg string `json:"msg"`
+ Page string `json:"page"`
+ PageCount int64 `json:"pagecount"`
+ Limit string `json:"limit"`
+ Total int64 `json:"total"`
+ List []MovieInfo `json:"list"`
+ Class []ClassInfo `json:"class"`
+}
+
+// MovieDetailInfo 影片详情数据 (只保留需要的部分)
+type MovieDetailInfo struct {
+ Id int64 `json:"vod_id"` //影片Id
+ Cid int64 `json:"type_id"` //分类ID
+ Pid int64 `json:"type_id_1"` //一级分类ID
+ Name string `json:"vod_name"` //片名
+ SubTitle string `json:"vod_sub"` //子标题
+ CName string `json:"type_name"` //分类名称
+ EnName string `json:"vod_en"` //英文名
+ Initial string `json:"vod_letter"` //首字母
+ ClassTag string `json:"vod_class"` //分类标签
+ Pic string `json:"vod_pic"` //简介图片
+ Actor string `json:"vod_actor"` //主演
+ Director string `json:"vod_director"` //导演
+ Writer string `json:"vod_writer"` //作者
+ Blurb string `json:"vod_blurb"` //简介, 残缺,不建议使用
+ Remarks string `json:"vod_remarks"` // 更新情况
+ PubDate string `json:"vod_pubdate"` //上映时间
+ Area string `json:"vod_area"` // 地区
+ Language string `json:"vod_lang"` //语言
+ Year string `json:"vod_year"` //年份
+ State string `json:"vod_state"` //影片状态 正片|预告...
+ UpdateTime string `json:"vod_time"` //更新时间
+ AddTime int64 `json:"vod_time_add"` //资源添加时间戳
+ DbId int64 `json:"vod_douban_id"` //豆瓣id
+ DbScore string `json:"vod_douban_score"` // 豆瓣评分
+ Content string `json:"vod_content"` //内容简介
+ PlayFrom string `json:"vod_play_from"` // 播放来源
+ PlaySeparator string `json:"vod_play_note"` // 播放信息分隔符
+ PlayUrl string `json:"vod_play_url"` //播放地址url
+ DownFrom string `json:"vod_down_from"` //下载来源 例: http
+ DownUrl string `json:"vod_down_url"` // 下载url地址
+}
+
+// DetailListInfo 影视详情信息
+type DetailListInfo struct {
+ Code int64 `json:"code"`
+ Msg string `json:"msg"`
+ Page int64 `json:"page"`
+ PageCount int64 `json:"pagecount"`
+ Limit string `json:"limit"`
+ Total int64 `json:"total"`
+ List []MovieDetailInfo `json:"list"`
+}
diff --git a/film/server/model/Movies.go b/film/server/model/Movies.go
new file mode 100644
index 0000000..fea9e00
--- /dev/null
+++ b/film/server/model/Movies.go
@@ -0,0 +1,332 @@
+package model
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/redis/go-redis/v9"
+ "log"
+ "server/config"
+ "server/plugin/db"
+ "strconv"
+ "strings"
+ "time"
+)
+
+// Movie 影片基本信息
+type Movie struct {
+ Id int64 `json:"id"` // 影片ID
+ Name string `json:"name"` // 影片名
+ Cid int64 `json:"cid"` // 所属分类ID
+ CName string `json:"CName"` // 所属分类名称
+ EnName string `json:"enName"` // 英文片名
+ Time string `json:"time"` // 更新时间
+ Remarks string `json:"remarks"` // 备注 | 清晰度
+ PlayFrom string `json:"playFrom"` // 播放来源
+}
+
+// MovieDescriptor 影片详情介绍信息
+type MovieDescriptor struct {
+ SubTitle string `json:"subTitle"` //子标题
+ CName string `json:"cName"` //分类名称
+ EnName string `json:"enName"` //英文名
+ Initial string `json:"initial"` //首字母
+ ClassTag string `json:"classTag"` //分类标签
+ Actor string `json:"actor"` //主演
+ Director string `json:"director"` //导演
+ Writer string `json:"writer"` //作者
+ Blurb string `json:"blurb"` //简介, 残缺,不建议使用
+ Remarks string `json:"remarks"` // 更新情况
+ ReleaseDate string `json:"releaseDate"` //上映时间
+ Area string `json:"area"` // 地区
+ Language string `json:"language"` //语言
+ Year string `json:"year"` //年份
+ State string `json:"state"` //影片状态 正片|预告...
+ UpdateTime string `json:"updateTime"` //更新时间
+ AddTime int64 `json:"addTime"` //资源添加时间戳
+ DbId int64 `json:"dbId"` //豆瓣id
+ DbScore string `json:"dbScore"` // 豆瓣评分
+ Content string `json:"content"` //内容简介
+}
+
+// MovieBasicInfo 影片基本信息
+type MovieBasicInfo struct {
+ Id int64 `json:"id"` //影片Id
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //一级分类ID
+ Name string `json:"name"` //片名
+ SubTitle string `json:"subTitle"` //子标题
+ CName string `json:"cName"` //分类名称
+ State string `json:"state"` //影片状态 正片|预告...
+ Picture string `json:"picture"` //简介图片
+ Actor string `json:"actor"` //主演
+ Director string `json:"director"` //导演
+ Blurb string `json:"blurb"` //简介, 不完整
+ Remarks string `json:"remarks"` // 更新情况
+ Area string `json:"area"` // 地区
+ Year string `json:"year"` //年份
+}
+
+// MovieUrlInfo 影视资源url信息
+type MovieUrlInfo struct {
+ Episode string `json:"episode"` // 集数
+ Link string `json:"link"` // 播放地址
+}
+
+// MovieDetail 影片详情信息
+type MovieDetail struct {
+ Id int64 `json:"id"` //影片Id
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //一级分类ID
+ Name string `json:"name"` //片名
+ Picture string `json:"picture"` //简介图片
+ PlayFrom []string `json:"playFrom"` // 播放来源
+ DownFrom string `json:"DownFrom"` //下载来源 例: http
+ //PlaySeparator string `json:"playSeparator"` // 播放信息分隔符
+ PlayList [][]MovieUrlInfo `json:"playList"` //播放地址url
+ DownloadList [][]MovieUrlInfo `json:"downloadList"` // 下载url地址
+ MovieDescriptor `json:"descriptor"` //影片描述信息
+}
+
+// SaveMoves 保存影片分页请求list
+func SaveMoves(list []Movie) (err error) {
+ // 整合数据
+ for _, m := range list {
+ //score, _ := time.ParseInLocation(time.DateTime, m.Time, time.Local)
+ movie, _ := json.Marshal(m)
+ // 以Cid为目录为集合进行存储, 便于后续搜索, 以影片id为分值进行存储 例 MovieList:Cid%d
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf(config.MovieListInfoKey, m.Cid), redis.Z{Score: float64(m.Id), Member: movie}).Err()
+ }
+ return err
+}
+
+// AllMovieInfoKey 获取redis中所有的影视列表信息key MovieList:Cid
+func AllMovieInfoKey() []string {
+ return db.Rdb.Keys(db.Cxt, fmt.Sprint("MovieList:Cid*")).Val()
+}
+
+// GetMovieListByKey 获取指定分类的影片列表数据
+func GetMovieListByKey(key string) []string {
+ return db.Rdb.ZRange(db.Cxt, key, 0, -1).Val()
+}
+
+// SaveDetails 保存影片详情信息到redis中 格式: MovieDetail:Cid?:Id?
+func SaveDetails(list []MovieDetail) (err error) {
+ // 遍历list中的信息
+ for _, detail := range list {
+ // 序列化影片详情信息
+ data, _ := json.Marshal(detail)
+ // 1. 原使用Zset存储, 但是不便于单个检索 db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Cid%d", config.MovieDetailKey, detail.Cid), redis.Z{Score: float64(detail.Id), Member: member}).Err()
+ // 改为普通 k v 存储, k-> id关键字, v json序列化的结果, //只保留十天, 没周更新一次
+ err = db.Rdb.Set(db.Cxt, fmt.Sprintf(config.MovieDetailKey, detail.Cid, detail.Id), data, config.CategoryTreeExpired).Err()
+ // 2. 同步保存简略信息到redis中
+ SaveMovieBasicInfo(detail)
+ // 3. 保存Search检索信息到redis
+ if err == nil {
+ // 转换 detail信息
+ searchInfo := ConvertSearchInfo(detail)
+ // 放弃redis进行检索, 多条件处理不方便
+ //err = AddSearchInfo(searchInfo)
+ // 只存储用于检索对应影片的关键字信息
+ SearchKeyword(searchInfo)
+ }
+
+ }
+ // 保存一份search信息到mysql, 批量存储
+ BatchSaveSearchInfo(list)
+ return err
+}
+
+// SaveMovieBasicInfo 摘取影片的详情部分信息转存为影视基本信息
+func SaveMovieBasicInfo(detail MovieDetail) {
+ basicInfo := MovieBasicInfo{
+ Id: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ SubTitle: detail.SubTitle,
+ CName: detail.CName,
+ State: detail.State,
+ Picture: detail.Picture,
+ Actor: detail.Actor,
+ Director: detail.Director,
+ Blurb: detail.Blurb,
+ Remarks: detail.Remarks,
+ Area: detail.Area,
+ Year: detail.Year,
+ }
+ data, _ := json.Marshal(basicInfo)
+ _ = db.Rdb.Set(db.Cxt, fmt.Sprintf(config.MovieBasicInfoKey, detail.Cid, detail.Id), data, config.CategoryTreeExpired).Err()
+}
+
+// AddSearchInfo 将影片关键字信息整合后存入search 集合中
+func AddSearchInfo(searchInfo SearchInfo) (err error) {
+ // 片名 Name 分类 CName 类别标签 classTag 地区 Area 语言 Language 年份 Year 首字母 Initial, 排序
+ data, _ := json.Marshal(searchInfo)
+ // 时间排序 score -->时间戳 DbId 排序 --> 热度, 评分排序 DbScore
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchTimeListKey, searchInfo.Pid), redis.Z{Score: float64(searchInfo.Time), Member: data}).Err()
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchScoreListKey, searchInfo.Pid), redis.Z{Score: searchInfo.Score, Member: data}).Err()
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchHeatListKey, searchInfo.Pid), redis.Z{Score: float64(searchInfo.Rank), Member: data}).Err()
+ // 添加搜索关键字信息
+ SearchKeyword(searchInfo)
+ return
+}
+
+// SearchKeyword 设置search关键字集合
+func SearchKeyword(search SearchInfo) {
+ // 首先获取redis中的search 关键字信息
+ key := fmt.Sprintf("%s:Pid%d", config.SearchKeys, search.Pid)
+ keyword := db.Rdb.HGetAll(db.Cxt, key).Val()
+ if keyword["Year"] == "" {
+ currentYear := time.Now().Year()
+ year := ""
+ for i := 0; i < 12; i++ {
+ // 提供当前年份前推十二年的搜索
+ year = fmt.Sprintf("%s,%d", year, currentYear-i)
+ }
+ initial := ""
+ for i := 65; i <= 90; i++ {
+ initial = fmt.Sprintf("%s,%c", initial, i)
+ }
+ keyword = map[string]string{
+ //"Name": "",
+ "Category": "",
+ "Tag": "",
+ "Area": "",
+ "Language": "",
+ "Year": strings.Trim(year, ","),
+ "Initial": strings.Trim(initial, ","),
+ "Sort": "Time,Db,Score", // 默认,一般不修改
+ }
+ }
+ // 分类标签处理
+ if !strings.Contains(keyword["Category"], search.CName) {
+ keyword["Category"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Category"], search.CName), ",")
+ }
+ // 影视内容分类处理
+ if strings.Contains(search.ClassTag, "/") {
+ for _, t := range strings.Split(search.ClassTag, "/") {
+ if !strings.Contains(keyword["Tag"], t) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], t), ",")
+ }
+ }
+ } else if strings.Contains(search.ClassTag, ",") {
+ for _, t := range strings.Split(search.ClassTag, ",") {
+ if !strings.Contains(keyword["Tag"], t) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], t), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Tag"], search.ClassTag) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], search.ClassTag), ",")
+ }
+ }
+ // 如果地区中包含 / 分隔符 则先进行切分处理
+ if strings.Contains(search.Area, "/") {
+ for _, s := range strings.Split(search.Area, "/") {
+ if !strings.Contains(keyword["Area"], strings.TrimSpace(s)) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], s), ",")
+ }
+ }
+ } else if strings.Contains(search.Area, ",") {
+ for _, s := range strings.Split(search.Area, ",") {
+ if !strings.Contains(keyword["Area"], strings.TrimSpace(s)) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], s), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Area"], search.Area) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], search.Area), ",")
+ }
+ }
+ // 语言处理
+ if strings.Contains(search.Language, "/") {
+ for _, l := range strings.Split(search.Language, "/") {
+ if !strings.Contains(keyword["Language"], l) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], l), ",")
+ }
+ }
+
+ } else if strings.Contains(search.Language, ",") {
+ for _, l := range strings.Split(search.Language, ",") {
+ if !strings.Contains(keyword["Language"], l) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], l), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Language"], search.Language) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], search.Language), ",")
+ }
+ }
+ _ = db.Rdb.HMSet(db.Cxt, key, keyword).Err()
+}
+
+// BatchSaveSearchInfo 批量保存Search信息
+func BatchSaveSearchInfo(list []MovieDetail) {
+ var infoList []SearchInfo
+ for _, v := range list {
+ infoList = append(infoList, ConvertSearchInfo(v))
+ }
+ // 将检索信息存入redis中做一次转存
+ RdbSaveSearchInfo(infoList)
+
+ // 废弃方案, 频繁大量入库容易引起主键冲突, 事务影响速率
+ // 批量插入时应对已存在数据进行检测, 使用mysql事务进行锁表
+ //BatchSave(infoList)
+ // 使用批量添加or更新
+ //BatchSaveOrUpdate(infoList)
+}
+
+// ConvertSearchInfo 将detail信息处理成 searchInfo
+func ConvertSearchInfo(detail MovieDetail) SearchInfo {
+ score, _ := strconv.ParseFloat(detail.DbScore, 64)
+ stamp, _ := time.ParseInLocation(time.DateTime, detail.UpdateTime, time.Local)
+ year, err := strconv.ParseInt(detail.Year, 10, 64)
+ if err != nil {
+ year = 0
+ }
+
+ return SearchInfo{
+ Mid: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ CName: detail.CName,
+ ClassTag: detail.ClassTag,
+ Area: detail.Area,
+ Language: detail.Language,
+ Year: year,
+ Initial: detail.Initial,
+ Score: score,
+ Rank: detail.DbId,
+ Time: stamp.Unix(),
+ State: detail.State,
+ Remarks: detail.Remarks,
+ // releaseDate 部分影片缺失该参数, 所以使用添加时间作为上映时间排序
+ ReleaseDate: detail.AddTime,
+ }
+}
+
+// GetBasicInfoByKey 获取Id对应的影片基本信息
+func GetBasicInfoByKey(key string) MovieBasicInfo {
+ // 反序列化得到的结果
+ data := []byte(db.Rdb.Get(db.Cxt, key).Val())
+ basic := MovieBasicInfo{}
+ _ = json.Unmarshal(data, &basic)
+ return basic
+}
+
+// GetDetailByKey 获取影片对应的详情信息
+func GetDetailByKey(key string) MovieDetail {
+ // 反序列化得到的结果
+ data := []byte(db.Rdb.Get(db.Cxt, key).Val())
+ detail := MovieDetail{}
+ _ = json.Unmarshal(data, &detail)
+ return detail
+}
+
+// SearchMovie 搜索关键字影片
+func SearchMovie() {
+ data, err := db.Rdb.ZScan(db.Cxt, "MovieList:cid30", 0, `*天使*`, config.SearchCount).Val()
+ log.Println(err)
+ fmt.Println(data)
+}
diff --git a/film/server/model/Search.go b/film/server/model/Search.go
new file mode 100644
index 0000000..bd03aa2
--- /dev/null
+++ b/film/server/model/Search.go
@@ -0,0 +1,291 @@
+package model
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/redis/go-redis/v9"
+ "gorm.io/gorm"
+ "log"
+ "reflect"
+ "regexp"
+ "server/config"
+ "server/plugin/db"
+ "strings"
+)
+
+// SearchInfo 存储用于检索的信息
+type SearchInfo struct {
+ gorm.Model
+ Mid int64 `json:"mid" gorm:"uniqueIndex:idx_mid"` //影片ID
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //上级分类ID
+ Name string `json:"name"` // 片名
+ CName string `json:"CName"` // 分类名称
+ ClassTag string `json:"classTag"` //类型标签
+ Area string `json:"area"` // 地区
+ Language string `json:"language"` // 语言
+ Year int64 `json:"year"` // 年份
+ Initial string `json:"initial"` // 首字母
+ Score float64 `json:"score"` //评分
+ Time int64 `json:"time"` // 更新时间
+ Rank int64 `json:"rank"` // 热度排行id
+ State string `json:"state"` //状态 正片|预告
+ Remarks string `json:"remarks"` // 完结 | 更新至x集
+ ReleaseDate int64 `json:"releaseDate"` //上映时间 时间戳
+}
+
+// Page 分页信息结构体
+type Page struct {
+ PageSize int `json:"pageSize"` // 每页大小
+ Current int `json:"current"` // 当前页
+ PageCount int `json:"pageCount"` // 总页数
+ Total int `json:"total"` // 总记录数
+ //List []interface{} `json:"list"` // 数据
+}
+
+func (s *SearchInfo) TableName() string {
+ return "search_lz"
+ //return "search_fs"
+}
+
+// ================================= Spider 数据处理(redis) =================================
+
+// RdbSaveSearchInfo 批量保存检索信息到redis
+func RdbSaveSearchInfo(list []SearchInfo) {
+ // 1.整合一下zset数据集
+ var members []redis.Z
+ for _, s := range list {
+ member, _ := json.Marshal(s)
+ members = append(members, redis.Z{Score: float64(s.Mid), Member: member})
+ }
+ // 2.批量保存到zset集合中
+ db.Rdb.ZAdd(db.Cxt, config.SearchInfoTemp, members...)
+}
+
+// ScanSearchInfo 批量扫描处理详情检索信息, 返回检索信息列表和下次开始的游标
+func ScanSearchInfo(cursor uint64, count int64) ([]SearchInfo, uint64) {
+ // 1.从redis中批量扫描详情信息
+ list, nextCursor := db.Rdb.ZScan(db.Cxt, config.SearchInfoTemp, cursor, "*", count).Val()
+ // 2. 处理数据
+ var resList []SearchInfo
+ for i, s := range list {
+ // 3. 判断当前是否是元素
+ if i%2 == 0 {
+ info := SearchInfo{}
+ _ = json.Unmarshal([]byte(s), &info)
+ info.Model = gorm.Model{}
+ resList = append(resList, info)
+ }
+ }
+ return resList, nextCursor
+}
+
+// RemoveAll 删除所有库存数据
+func RemoveAll() {
+ // 删除redis中当前库存储的所有数据
+ db.Rdb.FlushDB(db.Cxt)
+ // 删除mysql中留存的检索表
+ var s *SearchInfo
+ db.Mdb.Exec(fmt.Sprintf(`drop table if exists %s`, s.TableName()))
+}
+
+// ================================= Spider 数据处理(mysql) =================================
+
+// CreateSearchTable 创建存储检索信息的数据表
+func CreateSearchTable() {
+ // 1. 判断表中是否存在当前表
+ isExist := db.Mdb.Migrator().HasTable(&SearchInfo{})
+ // 如果不存在则创建表
+ if !isExist {
+ err := db.Mdb.AutoMigrate(&SearchInfo{})
+ if err != nil {
+ log.Println("Create Table SearchInfo Failed: ", err)
+ }
+ }
+}
+
+// BatchSave 批量保存影片search信息
+func BatchSave(list []SearchInfo) {
+ tx := db.Mdb.Begin()
+ // 防止程序异常终止
+ defer func() {
+ if r := recover(); r != nil {
+ tx.Rollback()
+ }
+ }()
+ if err := tx.CreateInBatches(list, len(list)).Error; err != nil {
+ // 插入失败则回滚事务, 重新进行插入
+ tx.Rollback()
+ return
+ }
+ // 插入成功后输出一下成功信息
+ //log.Println("BatchSave SearchInfo Successful, Count: ", len(list))
+ tx.Commit()
+}
+
+// BatchSaveOrUpdate 判断数据库中是否存在对应mid的数据, 如果存在则更新, 否则插入
+func BatchSaveOrUpdate(list []SearchInfo) {
+ tx := db.Mdb.Begin()
+ // 失败则回滚事务
+ //defer func() {
+ // if r := recover(); r != nil {
+ // tx.Rollback()
+ // }
+ //}()
+ for _, info := range list {
+ var count int64
+ // 通过当前影片id 对应的记录数
+ tx.Model(&SearchInfo{}).Where("mid", info.Mid).Count(&count)
+ // 如果存在对应数据则进行更新, 否则进行删除
+ if count > 0 {
+ // 记录已经存在则执行更新部分内容
+ err := tx.Model(&SearchInfo{}).Where("mid", info.Mid).Updates(SearchInfo{Time: info.Time, Rank: info.Rank, State: info.State,
+ Remarks: info.Remarks, Score: info.Score, ReleaseDate: info.ReleaseDate}).Error
+ if err != nil {
+ tx.Rollback()
+ }
+ } else {
+ // 执行插入操作
+ if err := tx.Create(&info).Error; err != nil {
+ tx.Rollback()
+ }
+ }
+ }
+ // 提交事务
+ tx.Commit()
+}
+
+// SaveSearchData 添加影片检索信息
+func SaveSearchData(s SearchInfo) {
+ // 先查询数据库中是否存在对应记录
+ isExist := SearchMovieInfo(s.Mid)
+ // 如果不存在对应记录则 保存当前记录
+ if !isExist {
+ db.Mdb.Create(&s)
+ }
+}
+
+// SearchMovieInfo 通过Mid查询符合条件的数据
+func SearchMovieInfo(mid int64) bool {
+ search := SearchInfo{}
+ db.Mdb.Where("mid", mid).First(&search)
+ // reflect.DeepEqual(a, A{})
+ return !reflect.DeepEqual(search, SearchInfo{})
+}
+
+// TunCateSearchTable 截断SearchInfo数据表
+func TunCateSearchTable() {
+ var searchInfo *SearchInfo
+ err := db.Mdb.Exec(fmt.Sprint("TRUNCATE TABLE ", searchInfo.TableName())).Error
+ if err != nil {
+ log.Println("TRUNCATE TABLE Error: ", err)
+ }
+}
+
+// ================================= API 数据接口信息处理 =================================
+
+// GetMovieListByPid 通过Pid 分类ID 获取对应影片的数据信息
+func GetMovieListByPid(pid int64, page *Page) []MovieBasicInfo {
+ // 返回分页参数
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("pid", pid).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 进行具体的信息查询
+ var s []SearchInfo
+ if err := db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).Where("pid", pid).Order("year DESC, time DESC").Find(&s).Error; err != nil {
+ log.Println(err)
+ return nil
+ }
+ // 通过影片ID去redis中获取id对应数据信息
+ var list []MovieBasicInfo
+ for _, v := range s {
+ // 通过key搜索指定的影片信息 , MovieDetail:Cid6:Id15441
+ list = append(list, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, v.Cid, v.Mid)))
+ }
+ return list
+}
+
+// SearchFilmKeyword 通过关键字搜索库存中满足条件的影片名
+func SearchFilmKeyword(keyword string, page *Page) []SearchInfo {
+ var searchList []SearchInfo
+ // 1. 先统计搜索满足条件的数据量
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("name LIKE ?", fmt.Sprint(`%`, keyword, `%`)).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 2. 获取满足条件的数据
+ db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).
+ Where("name LIKE ?", fmt.Sprint(`%`, keyword, `%`)).Order("year DESC, time DESC").Find(&searchList)
+ return searchList
+}
+
+// GetMovieListByCid 通过Cid查找对应的影片分页数据, 不适合GetMovieListByPid 糅合
+func GetMovieListByCid(cid int64, page *Page) []MovieBasicInfo {
+ // 返回分页参数
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("cid", cid).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 进行具体的信息查询
+ var s []SearchInfo
+ if err := db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).Where("cid", cid).Order("year DESC, time DESC").Find(&s).Error; err != nil {
+ log.Println(err)
+ return nil
+ }
+ // 通过影片ID去redis中获取id对应数据信息
+ var list []MovieBasicInfo
+ for _, v := range s {
+ // 通过key搜索指定的影片信息 , MovieDetail:Cid6:Id15441
+ list = append(list, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, v.Cid, v.Mid)))
+ }
+ return list
+}
+
+// GetRelateMovieBasicInfo GetRelateMovie 根据SearchInfo获取相关影片
+func GetRelateMovieBasicInfo(search SearchInfo, page *Page) []MovieBasicInfo {
+ /*
+ 根据当前影片信息匹配相关的影片
+ 1. 分类Cid,
+ 2. 如果影片名称含有第x季 则根据影片名进行模糊匹配
+ 3. class_tag 剧情内容匹配, 切分后使用 or 进行匹配
+ 4. area 地区
+ 5. 语言 Language
+ */
+
+ // sql 拼接查询条件
+ sql := ""
+ // 优先进行名称相似匹配
+ re := regexp.MustCompile("第.{1,3}季")
+ if re.MatchString(search.Name) {
+ search.Name = re.ReplaceAllString(search.Name, "")
+ sql = fmt.Sprintf(`select * from %s where name LIKE "%%%s%%" union`, search.TableName(), search.Name)
+ }
+ // 执行后续匹配内容
+ //sql = fmt.Sprintf(`%s select * from %s where cid=%d AND area="%s" AND language="%s" AND`, sql, search.TableName(), search.Cid, search.Area, search.Language)
+
+ // 地区限制取消, 过滤掉的影片太多
+ sql = fmt.Sprintf(`%s select * from %s where cid=%d AND language="%s" AND`, sql, search.TableName(), search.Cid, search.Language)
+ if strings.Contains(search.ClassTag, ",") {
+ s := "("
+ for _, t := range strings.Split(search.ClassTag, ",") {
+ s = fmt.Sprintf(`%s class_tag = "%s" OR`, s, t)
+ }
+ sql = fmt.Sprintf("%s %s)", sql, strings.TrimSuffix(s, "OR"))
+ } else {
+ sql = fmt.Sprintf(`%s class_tag = "%s"`, sql, search.ClassTag)
+ }
+ // 条件拼接完成后加上limit参数
+ sql = fmt.Sprintf("(%s) limit %d,%d", sql, page.Current, page.PageSize)
+ // 执行sql
+ list := []SearchInfo{}
+ db.Mdb.Raw(sql).Scan(&list)
+ // 根据list 获取对应的BasicInfo
+ var basicList []MovieBasicInfo
+ for _, s := range list {
+ // 通过key获取对应的影片基本数据
+ basicList = append(basicList, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, s.Cid, s.Mid)))
+ }
+
+ return basicList
+}
diff --git a/film/server/plugin/common/ProcessCategory.go b/film/server/plugin/common/ProcessCategory.go
new file mode 100644
index 0000000..2546f29
--- /dev/null
+++ b/film/server/plugin/common/ProcessCategory.go
@@ -0,0 +1,38 @@
+package common
+
+import (
+ "server/model"
+)
+
+// =================Spider数据处理=======================
+
+// CategoryTree 组装树形菜单
+func CategoryTree(list []model.ClassInfo) *model.CategoryTree {
+ // 遍历所有分类进行树形结构组装
+ tree := &model.CategoryTree{Category: &model.Category{Id: 0, Pid: -1, Name: "分类信息"}}
+ temp := make(map[int64]*model.CategoryTree)
+ temp[tree.Id] = tree
+
+ for _, c := range list {
+ // 判断当前节点ID是否存在于 temp中
+ category, ok := temp[c.Id]
+ if ok {
+ // 将当前节点信息保存
+ category.Category = &model.Category{Id: c.Id, Pid: c.Pid, Name: c.Name}
+ } else {
+ // 如果不存在则将当前分类存放到 temp中
+ category = &model.CategoryTree{Category: &model.Category{Id: c.Id, Pid: c.Pid, Name: c.Name}}
+ temp[c.Id] = category
+ }
+ // 根据 pid获取父节点信息
+ parent, ok := temp[category.Pid]
+ if !ok {
+ // 如果不存在父节点存在, 则将父节点存放到temp中
+ temp[c.Pid] = parent
+ }
+ // 将当前节点存放到父节点的Children中
+ parent.Children = append(parent.Children, category)
+ }
+
+ return tree
+}
diff --git a/film/server/plugin/common/ProcessMovies.go b/film/server/plugin/common/ProcessMovies.go
new file mode 100644
index 0000000..5b8f3b7
--- /dev/null
+++ b/film/server/plugin/common/ProcessMovies.go
@@ -0,0 +1,99 @@
+package common
+
+import (
+ "server/model"
+ "strings"
+)
+
+// ProcessMovieListInfo 处理影片列表中的信息, 后续增加片源可提通过type属性进行对应转换
+func ProcessMovieListInfo(list []model.MovieInfo) []model.Movie {
+ var movies []model.Movie
+ for _, info := range list {
+ movies = append(movies, model.Movie{
+ Id: info.Id,
+ Name: info.Name,
+ Cid: info.Cid,
+ CName: info.CName,
+ EnName: info.EnName,
+ Time: info.Time,
+ Remarks: info.Remarks,
+ PlayFrom: info.PlayFrom,
+ })
+ }
+ return movies
+}
+
+// ProcessMovieDetailList 处理影片详情列表数据
+func ProcessMovieDetailList(list []model.MovieDetailInfo) []model.MovieDetail {
+ var detailList []model.MovieDetail
+ for _, d := range list {
+ detailList = append(detailList, ProcessMovieDetail(d))
+ }
+ return detailList
+}
+
+// ProcessMovieDetail 处理单个影片详情信息
+func ProcessMovieDetail(detail model.MovieDetailInfo) model.MovieDetail {
+ md := model.MovieDetail{
+ Id: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ Picture: detail.Pic,
+ DownFrom: detail.DownFrom,
+ MovieDescriptor: model.MovieDescriptor{
+ SubTitle: detail.SubTitle,
+ CName: detail.CName,
+ EnName: detail.EnName,
+ Initial: detail.Initial,
+ ClassTag: detail.ClassTag,
+ Actor: detail.Actor,
+ Director: detail.Director,
+ Writer: detail.Writer,
+ Blurb: detail.Blurb,
+ Remarks: detail.Remarks,
+ ReleaseDate: detail.PubDate,
+ Area: detail.Area,
+ Language: detail.Language,
+ Year: detail.Year,
+ State: detail.State,
+ UpdateTime: detail.UpdateTime,
+ AddTime: detail.AddTime,
+ DbId: detail.DbId,
+ DbScore: detail.DbScore,
+ Content: detail.Content,
+ },
+ }
+ // 通过分割符切分播放源信息 PlaySeparator $$$
+ md.PlayFrom = strings.Split(detail.PlayFrom, detail.PlaySeparator)
+ md.PlayList = ProcessPlayInfo(detail.PlayUrl, detail.PlaySeparator)
+ md.DownloadList = ProcessPlayInfo(detail.DownUrl, detail.PlaySeparator)
+ return md
+}
+
+// ProcessPlayInfo 处理影片播放数据信息
+func ProcessPlayInfo(info, sparator string) [][]model.MovieUrlInfo {
+ var res [][]model.MovieUrlInfo
+ // 1. 通过分隔符区分多个片源数据
+ for _, l := range strings.Split(info, sparator) {
+ // 2.对每个片源的集数和播放地址进行分割
+ var item []model.MovieUrlInfo
+ for _, p := range strings.Split(l, "#") {
+ // 3. 处理 Episode$Link 形式的播放信息
+ if strings.Contains(p, "$") {
+ item = append(item, model.MovieUrlInfo{
+ Episode: strings.Split(p, "$")[0],
+ Link: strings.Split(p, "$")[1],
+ })
+ } else {
+ item = append(item, model.MovieUrlInfo{
+ Episode: "O(∩_∩)O",
+ Link: p,
+ })
+ }
+ }
+ // 3. 将每组播放源对应的播放列表信息存储到列表中
+ res = append(res, item)
+ }
+ return res
+}
diff --git a/film/server/plugin/db/mysql.go b/film/server/plugin/db/mysql.go
new file mode 100644
index 0000000..f7e518a
--- /dev/null
+++ b/film/server/plugin/db/mysql.go
@@ -0,0 +1,30 @@
+package db
+
+import (
+ "gorm.io/driver/mysql"
+ "gorm.io/gorm"
+ "gorm.io/gorm/schema"
+ "server/config"
+)
+
+var Mdb *gorm.DB
+
+func InitMysql() (err error) {
+ // client 相关属性设置
+ Mdb, err = gorm.Open(mysql.New(mysql.Config{
+ DSN: config.MysqlDsn,
+ DefaultStringSize: 255, //string类型字段默认长度
+ DisableDatetimePrecision: true, // 禁用 datetime 精度
+ DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式
+ DontSupportRenameColumn: true, // 用change 重命名列
+ SkipInitializeWithVersion: false, // 根据当前Mysql版本自动配置
+ }), &gorm.Config{
+ NamingStrategy: schema.NamingStrategy{
+ //TablePrefix: "t_", //设置创建表时的前缀
+ SingularTable: true, //是否使用 结构体名称作为表名 (关闭自动变复数)
+ //NameReplacer: strings.NewReplacer("spider_", ""), // 替表名和字段中的 Me 为 空
+ },
+ //Logger: logger.Default.LogMode(logger.Info), //设置日志级别为Info
+ })
+ return
+}
diff --git a/film/server/plugin/db/redis.go b/film/server/plugin/db/redis.go
new file mode 100644
index 0000000..5a22493
--- /dev/null
+++ b/film/server/plugin/db/redis.go
@@ -0,0 +1,37 @@
+package db
+
+import (
+ "context"
+ "github.com/redis/go-redis/v9"
+ "server/config"
+ "time"
+)
+
+/*
+redis 工具类
+*/
+var Rdb *redis.Client
+var Cxt = context.Background()
+
+// InitRedisConn 初始化redis客户端
+func InitRedisConn() error {
+
+ Rdb = redis.NewClient(&redis.Options{
+ Addr: config.RedisAddr,
+ Password: config.RedisPassword,
+ DB: config.RedisDBNo,
+ PoolSize: 10, // 默认连接数
+ DialTimeout: time.Second * 10, // 超时时间
+ })
+ // 测试连接是否正常
+ _, err := Rdb.Ping(Cxt).Result()
+ if err != nil {
+ panic(err)
+ }
+ return nil
+}
+
+// 关闭redis连接
+func CloseRedis() error {
+ return Rdb.Close()
+}
diff --git a/film/server/plugin/spider/Spider.go b/film/server/plugin/spider/Spider.go
new file mode 100644
index 0000000..d206fdf
--- /dev/null
+++ b/film/server/plugin/spider/Spider.go
@@ -0,0 +1,350 @@
+package spider
+
+import (
+ "encoding/json"
+ "fmt"
+ "log"
+ "net/url"
+ "server/config"
+ "server/model"
+ "server/plugin/common"
+ "strings"
+ "sync"
+ "time"
+)
+
+/*
+ 公共资源采集站点
+ 1. 视频列表请求参数
+ ac=list 列表数据, t 影视类型ID, pg 页码, wd 关键字, h 几小时内数据
+ 2. 视频详情请求参数
+ ac=detail 详情数据, ids 影片id列表, h, pg, t 影视类型ID
+*/
+const (
+ LZ_MOVIES_URL = "https://cj.lziapi.com/api.php/provide/vod/"
+ LZ_MOVIES_Bk_URL = "https://cj.lzcaiji.com/api.php/provide/vod/"
+ TK_MOVIES_URL = "https://api.tiankongapi.com/api.php/provide/vod"
+ KC_MOVIES_URL = "https://caiji.kczyapi.com/api.php/provide/vod/"
+ FS_MOVIES_URL = "https://www.feisuzyapi.com/api.php/provide/vod/"
+
+ // FILM_COLLECT_SITE 当前使用的采集URL
+ FILM_COLLECT_SITE = "https://www.feisuzyapi.com/api.php/provide/vod/"
+)
+
+// 定义一个同步等待组
+var wg = &sync.WaitGroup{}
+
+func StartSpider() {
+ // 1. 先拉取全部分类信息
+ CategoryList()
+
+ //2. 拉取所有分类下的影片基本信息
+ tree := model.GetCategoryTree()
+ AllMovies(&tree)
+ wg.Wait()
+ log.Println("AllMovies 影片列表获取完毕")
+
+ // 3. 获取入库的所有影片详情信息
+ // 3.2 获取入库的所有影片的详情信息
+ AllMovieInfo()
+ log.Println("AllMovieInfo 所有影片详情获取完毕")
+
+ // 4. mysql批量插入与数据爬取同时进行容易出现主键冲突, 因此滞后
+ // 4.1 先一步将输入存入redis中, 待网络io结束后再进行分批扫描入库
+ // 3.1 先查找并创建search数据库
+ time.Sleep(time.Second * 10)
+ model.CreateSearchTable()
+ SearchInfoToMdb()
+ log.Println("SearchInfoToMdb 影片检索信息保存完毕")
+ time.Sleep(time.Second * 10)
+}
+
+// CategoryList 获取分类数据
+func CategoryList() {
+ // 设置请求参数信息
+ r := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`pg`, "1")
+ r.Params.Set(`t`, "1")
+ // 执行请求, 获取一次list数据
+ ApiGet(&r)
+ // 解析resp数据
+ movieListInfo := model.MovieListInfo{}
+ if len(r.Resp) <= 0 {
+ log.Println("MovieListInfo数据获取异常 : Resp Is Empty")
+ }
+ _ = json.Unmarshal(r.Resp, &movieListInfo)
+ // 获取分类列表信息
+ classList := movieListInfo.Class
+ // 组装分类数据信息树形结构
+ categoryTree := common.CategoryTree(classList)
+ // 序列化tree
+ data, _ := json.Marshal(categoryTree)
+ // 保存 tree 到redis
+ err := model.SaveCategoryTree(string(data))
+ if err != nil {
+ log.Println("SaveCategoryTree Error: ", err)
+ }
+}
+
+// AllMovies 遍历所有分类, 获取所有二级分类数据
+func AllMovies(tree *model.CategoryTree) {
+ // 遍历一级分类
+ for _, c := range tree.Children {
+ // 遍历二级分类, 屏蔽主页不需要的影片信息, 只获取 电影1 电视剧2 综艺3 动漫4等分类下的信息
+ //len(c.Children) > 0 && c.Id <= 4
+ if len(c.Children) > 0 {
+ for _, cInfo := range c.Children {
+ //go CategoryAllMovie(cInfo.Category)
+ CategoryAllMoviePlus(cInfo.Category)
+ }
+ }
+ }
+}
+
+// CategoryAllMovie 获取指定分类的所有影片基本信息
+func CategoryAllMovie(c *model.Category) {
+ // 添加一个等待任务, 执行完减去一个任务
+ wg.Add(1)
+ defer wg.Done()
+ // 设置请求参数
+ r := &RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`t`, fmt.Sprint(c.Id))
+ ApiGet(r)
+ // 解析请求数据
+ listInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &listInfo)
+ // 获取pageCount信息, 循环获取所有页数据
+ pageCount := listInfo.PageCount
+ // 开始获取所有信息, 使用协程并发获取数据
+ for i := 1; i <= int(pageCount); i++ {
+ // 使用新的 请求参数
+ r.Params.Set(`pg`, fmt.Sprint(i))
+ // 保存当前分类下的影片信息
+ info := model.MovieListInfo{}
+ ApiGet(r)
+ // 如果返回数据中的list为空,则直接结束本分类的资源获取
+ if len(r.Resp) <= 0 {
+ log.Println("SaveMoves Error Response Is Empty")
+ break
+ }
+ _ = json.Unmarshal(r.Resp, &info)
+ if info.List == nil {
+ log.Println("MovieList Is Empty")
+ break
+ }
+ // 处理影片信息
+ list := common.ProcessMovieListInfo(info.List)
+ // 保存影片信息至redis
+ _ = model.SaveMoves(list)
+ }
+}
+
+// CategoryAllMoviePlus 部分分类页数很多,因此采用单分类多协程拉取
+func CategoryAllMoviePlus(c *model.Category) {
+ // 设置请求参数
+ r := &RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`t`, fmt.Sprint(c.Id))
+ ApiGet(r)
+ // 解析请求数据
+ listInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &listInfo)
+ // 获取pageCount信息, 循环获取所有页数据
+ pageCount := listInfo.PageCount
+ // 使用chan + goroutine 进行并发获取
+ chPg := make(chan int, int(pageCount))
+ chClose := make(chan int)
+ // 开始获取所有信息, 使用协程并发获取数据
+ for i := 1; i <= int(pageCount); i++ {
+ // 将当前分类的所有页码存入chPg
+ chPg <- i
+ }
+ close(chPg)
+ // 开启MAXGoroutine数量的协程进行请求
+ for i := 0; i < config.MAXGoroutine; i++ {
+ go func() {
+ // 当前协程结束后向 chClose中写入一次数据
+ defer func() { chClose <- 0 }()
+ for {
+ pg, ok := <-chPg
+ if !ok {
+ return
+ }
+ // 使用新的 请求参数
+ req := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ req.Params.Set(`ac`, "list")
+ req.Params.Set(`t`, fmt.Sprint(c.Id))
+ req.Params.Set(`pg`, fmt.Sprint(pg))
+ // 保存当前分类下的影片信息
+ info := model.MovieListInfo{}
+ ApiGet(&req)
+ // 如果返回数据中的list为空,则直接结束本分类的资源获取
+ if len(r.Resp) <= 0 {
+ log.Println("SaveMoves Error Response Is Empty")
+ return
+ }
+ _ = json.Unmarshal(r.Resp, &info)
+ if info.List == nil {
+ log.Println("MovieList Is Empty")
+ return
+ }
+ // 处理影片信息
+ list := common.ProcessMovieListInfo(info.List)
+ // 保存影片信息至redis
+ _ = model.SaveMoves(list)
+ }
+ }()
+ }
+ // 使用chClose等待当前分类列表数据请求完毕
+ for i := 0; i < config.MAXGoroutine; i++ {
+ <-chClose
+ }
+}
+
+// AllMovieInfo 拉取全部影片的基本信息
+func AllMovieInfo() {
+ keys := model.AllMovieInfoKey()
+ for _, key := range keys {
+ // 获取当前分类下的sort set数据集合
+ movies := model.GetMovieListByKey(key)
+ ids := ""
+ for i, m := range movies {
+ // 反序列化获取影片基本信息
+ movie := model.Movie{}
+ err := json.Unmarshal([]byte(m), &movie)
+ if err == nil && movie.Id != 0 {
+ // 拼接ids信息
+ ids = fmt.Sprintf("%s,%d", ids, movie.Id)
+ }
+ // 每20个id执行一次请求, limit 最多20
+ if (i+1)%20 == 0 {
+ // ids对应影片的详情信息
+ go MoviesDetails(strings.Trim(ids, ","))
+ ids = ""
+ }
+ }
+ // 如果ids != "" , 将剩余id执行一次请求
+ MoviesDetails(strings.Trim(ids, ","))
+ }
+}
+
+// MoviesDetails 获取影片详情信息, ids 影片id,id,....
+func MoviesDetails(ids string) {
+ // // 添加一个等待任务, 执行完减去一个任务
+ //wg.Add(1)
+ //defer wg.Done()
+ // 如果ids为空数据则直接返回
+ if len(ids) <= 0 {
+ return
+ }
+ // 设置请求参数
+ r := RequestInfo{
+ Uri: FILM_COLLECT_SITE,
+ Params: url.Values{},
+ }
+ r.Params.Set("ac", "detail")
+ r.Params.Set("ids", ids)
+ ApiGet(&r)
+ // 映射详情信息
+ details := model.DetailListInfo{}
+ // 如果返回数据为空则直接结束本次方法
+ if len(r.Resp) <= 0 {
+ return
+ }
+ // 序列化详情数据
+ err := json.Unmarshal(r.Resp, &details)
+ if err != nil {
+ log.Println("DetailListInfo Unmarshal Error: ", err)
+ return
+ }
+ // 处理details信息
+ list := common.ProcessMovieDetailList(details.List)
+ // 保存影片详情信息到redis
+ err = model.SaveDetails(list)
+ if err != nil {
+ log.Println("SaveDetails Error: ", err)
+ }
+}
+
+// SearchInfoToMdb 扫描redis中的检索信息, 并批量存入mysql
+func SearchInfoToMdb() {
+ // 1. 从redis的Zset集合中scan扫描数据, 每次100条
+ var cursor uint64 = 0
+ var count int64 = 100
+ for {
+ infoList, nextStar := model.ScanSearchInfo(cursor, count)
+ // 2. 将扫描到的数据插入mysql中
+ model.BatchSave(infoList)
+ // 3.设置下次开始的游标
+ cursor = nextStar
+ // 4. 判断迭代是否已经结束 cursor为0则表示已经迭代完毕
+ if cursor == 0 {
+ return
+ }
+ }
+
+}
+
+// GetRecentMovie 获取最近更的影片, 默认最近3小时
+func GetRecentMovie() {
+ // 请求URL URI?ac=list&h=6
+ r := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set("ac", "list")
+ r.Params.Set("pg", "1")
+ r.Params.Set("h", config.UpdateInterval)
+ // 执行请求获取分页信息
+ ApiGet(&r)
+ if len(r.Resp) < 0 {
+ log.Println("更新数据获取失败")
+ return
+ }
+ pageInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &pageInfo)
+ // 获取分页数据
+ ids := ""
+ // 存储检索信息
+ var tempSearchList []model.SearchInfo
+ // 获取影片详细数据,并保存到redis中
+ for i := 1; i <= int(pageInfo.PageCount); i++ {
+ // 执行获取影片基本信息
+ r.Params.Set("pg", fmt.Sprint(i))
+ ApiGet(&r)
+ // 解析请求的结果
+ if len(r.Resp) < 0 {
+ log.Println("更新数据获取失败")
+ return
+ }
+ info := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &info)
+ // 将影片信息保存到 movieList
+ list := common.ProcessMovieListInfo(info.List)
+ _ = model.SaveMoves(list)
+ // 拼接ids 用于请求detail信息
+ for _, m := range list {
+ ids = fmt.Sprintf("%s,%d", ids, m.Id)
+ // 保存一份id切片用于添加mysql检索信息
+ tempSearchList = append(tempSearchList, model.SearchInfo{Mid: m.Id, Cid: m.Cid})
+ }
+ // 执行获取详情请求
+ MoviesDetails(strings.Trim(ids, ","))
+ ids = ""
+ }
+ // 根据idList 补全对应影片的searInfo信息
+ var sl []model.SearchInfo
+ for _, s := range tempSearchList {
+ // 通过id 获取对应的详情信息
+ sl = append(sl, model.ConvertSearchInfo(model.GetDetailByKey(fmt.Sprintf(config.MovieDetailKey, s.Cid, s.Mid))))
+ }
+ // 调用批量保存或更新方法, 如果对应mid数据存在则更新, 否则执行插入
+ model.BatchSaveOrUpdate(sl)
+}
+
+// StartSpiderRe 清空存储数据,从零开始获取
+func StartSpiderRe() {
+ // 删除已有的存储数据, redis 和 mysql中的存储数据全部清空
+ model.RemoveAll()
+ // 执行完整数据获取
+ StartSpider()
+}
diff --git a/film/server/plugin/spider/SpiderCron.go b/film/server/plugin/spider/SpiderCron.go
new file mode 100644
index 0000000..4e64373
--- /dev/null
+++ b/film/server/plugin/spider/SpiderCron.go
@@ -0,0 +1,29 @@
+package spider
+
+import (
+ "github.com/robfig/cron/v3"
+ "log"
+ "server/config"
+)
+
+// RegularUpdateMovie 定时更新, 每半小时获取一次站点的最近x小时数据
+func RegularUpdateMovie() {
+ c := cron.New(cron.WithSeconds())
+ // 开启定时任务每x 分钟更新一次最近x小时的影片数据
+ _, err := c.AddFunc(config.CornMovieUpdate, func() {
+ // 执行更新最近x小时影片的Spider
+ log.Println("执行一次影片更新任务...")
+ GetRecentMovie()
+ })
+
+ // 开启定时任务每月最后一天凌晨两点, 执行一次清库重取数据
+ _, err = c.AddFunc(config.CornUpdateAll, func() {
+ StartSpiderRe()
+ })
+
+ if err != nil {
+ log.Println("Corn Start Error: ", err)
+ }
+
+ c.Start()
+}
diff --git a/film/server/plugin/spider/SpiderRequest.go b/film/server/plugin/spider/SpiderRequest.go
new file mode 100644
index 0000000..198867f
--- /dev/null
+++ b/film/server/plugin/spider/SpiderRequest.go
@@ -0,0 +1,68 @@
+package spider
+
+import (
+ "fmt"
+ "github.com/gocolly/colly/v2"
+ "log"
+ "net/http"
+ "net/url"
+ "time"
+)
+
+var (
+ Client = CreateClient()
+)
+
+// RequestInfo 请求参数结构体
+type RequestInfo struct {
+ Uri string `json:"uri"` // 请求url地址
+ Params url.Values `json:"params"` // 请求参数
+ Header http.Header `json:"header"` // 请求头数据
+ Resp []byte `json:"resp"` // 响应结果数据
+}
+
+// CreateClient 初始化请求客户端
+func CreateClient() *colly.Collector {
+ c := colly.NewCollector()
+ // 设置代理信息
+ //if proxy, err := proxy.RoundRobinProxySwitcher("127.0.0.1:7890"); err != nil {
+ // c.SetProxyFunc(proxy)
+ //}
+ // 设置并发数量控制
+ //c.Async = true
+ // 访问深度
+ c.MaxDepth = 1
+ //可重复访问
+ c.AllowURLRevisit = true
+ // 设置超时时间 默认10s
+ c.SetRequestTimeout(20 * time.Second)
+ // 发起请求之前会调用的方法
+ c.OnRequest(func(request *colly.Request) {
+ // 设置一些请求头信息
+ request.Headers.Set("Content-Type", "application/json;charset=UTF-8")
+ request.Headers.Set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36")
+ //request.Headers.Set("cookie", "ge_ua_key=sxo%2Bz4kkS7clWpEtg2m7HioRfIo%3D")
+ request.Headers.Set("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
+ })
+ // 请求期间报错的回调
+ c.OnError(func(response *colly.Response, err error) {
+ log.Printf("请求异常: URL: %s Error: %s\n", response.Request.URL, err)
+ })
+ return c
+}
+
+// ApiGet 请求数据的方法
+func ApiGet(r *RequestInfo) {
+ // 请求成功后的响应
+ Client.OnResponse(func(response *colly.Response) {
+ // 将响应结构封装到 RequestInfo.Resp中
+ r.Resp = response.Body
+ // 拿到response后输出请求url
+ //log.Println("\n请求成功: ", response.Request.URL)
+ })
+ // 处理请求参数
+ err := Client.Visit(fmt.Sprintf("%s?%s", r.Uri, r.Params.Encode()))
+ if err != nil {
+ log.Println("获取数据失败: ", err)
+ }
+}
diff --git a/film/server/router/router.go b/film/server/router/router.go
new file mode 100644
index 0000000..534e2ff
--- /dev/null
+++ b/film/server/router/router.go
@@ -0,0 +1,68 @@
+package router
+
+import (
+ "github.com/gin-gonic/gin"
+ "log"
+ "net/http"
+ "server/controller"
+)
+
+func SetupRouter() *gin.Engine {
+
+ r := gin.Default()
+ // 开启跨域
+ r.Use(Cors())
+
+ r.GET(`/index`, controller.Index)
+ r.GET(`/navCategory`, controller.CategoriesInfo)
+ r.GET(`/filmDetail`, controller.FilmDetail)
+ r.GET(`/filmPlayInfo`, controller.FilmPlayInfo)
+ r.GET(`/searchFilm`, controller.SearchFilm)
+ r.GET(`/filmCategory`, controller.FilmCategory)
+
+ // 触发spider
+ spiderRoute := r.Group(`/spider`)
+ {
+ // 清空全部数据并从零开始获取数据
+ spiderRoute.GET("/SpiderRe", controller.SpiderRe)
+ // 获取影片详情, 用于网路不稳定导致的影片数据缺失
+ spiderRoute.GET(`/FixFilmDetail`, controller.FixFilmDetail)
+ }
+
+ return r
+}
+
+// Cors 开启跨域请求
+func Cors() gin.HandlerFunc {
+ return func(c *gin.Context) {
+ method := c.Request.Method
+ origin := c.Request.Header.Get("Origin") //请求头部
+ if origin != "" {
+ //接收客户端发送的origin (重要!)
+ c.Writer.Header().Set("Access-Control-Allow-Origin", origin)
+ //服务器支持的所有跨域请求的方法
+ c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE")
+ //允许跨域设置可以返回其他子段,可以自定义字段
+ c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token,session, Content-Type")
+ // 允许浏览器(客户端)可以解析的头部 (重要)
+ c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type")
+ //设置缓存时间
+ c.Header("Access-Control-Max-Age", "172800")
+ //允许客户端传递校验信息比如 cookie (重要)
+ c.Header("Access-Control-Allow-Credentials", "true")
+ }
+
+ //允许类型校验
+ if method == "OPTIONS" {
+ c.JSON(http.StatusOK, "ok!")
+ }
+
+ defer func() {
+ if err := recover(); err != nil {
+ log.Printf("Panic info is: %v", err)
+ }
+ }()
+
+ c.Next()
+ }
+}
diff --git a/server/.idea/.gitignore b/server/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/server/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/server/.idea/modules.xml b/server/.idea/modules.xml
new file mode 100644
index 0000000..fbd90b4
--- /dev/null
+++ b/server/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/.idea/server.iml b/server/.idea/server.iml
new file mode 100644
index 0000000..5e764c4
--- /dev/null
+++ b/server/.idea/server.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/server/README.md b/server/README.md
new file mode 100644
index 0000000..f6da4f6
--- /dev/null
+++ b/server/README.md
@@ -0,0 +1,83 @@
+# Film Server
+
+## 简介
+
+- server 是本项目的后端项目
+- 主要用于提供前端项目需要的 API数据接口, 以及数据搜集和更新
+- 实现思路 :
+ - 使用 gocolly 获取公开的影视资源,
+ - 将请求数据通过程序处理整合成统一格式后使用redis进行暂存
+ - 使用 mysql 存储收录的影片的检索信息, 用于影片检索, 分类
+ - 使用 gin 作为web服务, 提供相应api接口
+- 项目依赖
+
+```go
+# gin web服务框架, 用于处理与前端工程的交互
+github.com/gin-gonic/gin v1.9.0
+# gocolly go语言爬虫框架, 用于搜集公共影视资源
+github.com/gocolly/colly/v2 v2.1.0
+# go-redis redis交互程序
+github.com/redis/go-redis/v9 v9.0.2
+# gorm 用于处理与mysql数据库的交互
+gorm.io/gorm v1.24.6
+gorm.io/driver/mysql v1.4.7
+```
+
+
+
+## 项目结构
+
+> 项目主要目录结构
+
+- config 用于存放项目中使用的配置信息和静态常量
+- controller 请求处理控制器
+- logic 请求处理逻辑实现
+- model 数据模型结构体以及与数据库交互
+- plugin 项目所需的插件工具集合
+ - common 公共依赖
+ - db 数据库配置信息
+ - spider gocolly配置, 执行逻辑, 数据前置处理等
+
+```text
+server
+├─ config
+│ └─ DataConfig.go
+├─ controller
+│ ├─ IndexController.go
+│ └─ SpiderController.go
+├─ logic
+│ └─ IndexLogic.go
+├─ model
+│ ├─ Categories.go
+│ ├─ LZJson.go
+│ ├─ Movies.go
+│ └─ Search.go
+├─ plugin
+│ ├─ common
+│ │ ├─ JsonUtils.go
+│ │ ├─ ProcessCategory.go
+│ │ └─ ProcessMovies.go
+│ ├─ db
+│ │ ├─ mysql.go
+│ │ └─ redis.go
+│ └─ spider
+│ ├─ Spider.go
+│ ├─ SpiderCron.go
+│ └─ SpiderRequest.go
+├─ router
+│ └─ router.go
+├─ go.mod
+├─ go.sum
+├─ main.go
+└─ README.md
+```
+
+
+
+## 启动方式
+
+### 本地运行
+
+1. 修改 /server/plugin/db 目录下的 mysql.go 和 redis.go 中的连接地址和用户名密码
+2. 在 server 目录下执行 `go run main.go`
+
diff --git a/server/config/DataConfig.go b/server/config/DataConfig.go
new file mode 100644
index 0000000..0717641
--- /dev/null
+++ b/server/config/DataConfig.go
@@ -0,0 +1,70 @@
+package config
+
+import "time"
+
+/*
+定义一些数据库存放的key值
+*/
+const (
+
+ // CategoryTreeKey 分类树 key
+ CategoryTreeKey = "CategoryTree"
+ CategoryTreeExpired = time.Hour * 24 * 90
+ // MovieListInfoKey movies分类列表 key
+ MovieListInfoKey = "MovieList:Cid%d"
+ // MAXGoroutine max goroutine, 执行spider中对协程的数量限制
+ MAXGoroutine = 6
+ // MovieDetailKey movie detail影视详情信息 可以
+ MovieDetailKey = "MovieDetail:Cid%d:Id%d"
+ // MovieBasicInfoKey 影片基本信息, 简略版本
+ MovieBasicInfoKey = "MovieBasicInfoKey:Cid%d:Id%d"
+
+ // SearchCount Search scan 识别范围
+ SearchCount = 3000
+ // SearchKeys Search Key Hash
+ SearchKeys = "SearchKeys"
+ // SearchScoreListKey 根据评分检索的key
+ SearchScoreListKey = "Search:SearchScoreList"
+ SearchTimeListKey = "Search:SearchTimeList"
+ SearchHeatListKey = "Search:SearchHeatList"
+ // SearchInfoTemp redis暂存检索数据信息
+ SearchInfoTemp = "Search:SearchInfoTemp"
+
+ // CornMovieUpdate 影片更新定时任务间隔
+ CornMovieUpdate = "0 0/20 * * * ?"
+ // UpdateInterval 获取最近几小时更新的影片 (h 小时) 默认3小时
+ UpdateInterval = "3"
+ // CornUpdateAll 每月28执行一次清库更新
+ CornUpdateAll = "0 0 2 28 * ?"
+
+ // SpiderCipher 设置Spider触发指令
+ SpiderCipher = "Life in a different world from zero"
+)
+
+const (
+ /*
+ mysql服务配置信息
+ */
+ MysqlDsn = "root:root@(192.168.20.10:3307)/FilmSite?charset=utf8mb4&parseTime=True&loc=Local"
+ /*
+ docker compose 环境下的链接信息
+ mysql:3306 为 docker compose 中 mysql服务对应的网络名称和端口
+ UserName:Password 设置mysql账户的用户名和密码
+ */
+ //MysqlDsn = "UserName:Password@(mysql:3306)/FilmSite?charset=utf8mb4&parseTime=True&loc=Local"
+
+ /*
+ redis 配置信息
+ RedisAddr host:port
+ RedisPassword redis访问密码
+ RedisDBNo 使用第几号库
+ */
+ RedisAddr = `192.168.20.10:6379`
+ RedisPassword = `root`
+ RedisDBNo = 0
+
+ // docker compose 环境下运行如下配置信息
+ //RedisAddr = `redis:6379`
+ //RedisPassword = `Password`
+ //RedisDBNo = 0
+)
diff --git a/server/controller/IndexController.go b/server/controller/IndexController.go
new file mode 100644
index 0000000..5c49a56
--- /dev/null
+++ b/server/controller/IndexController.go
@@ -0,0 +1,160 @@
+package controller
+
+import (
+ "github.com/gin-gonic/gin"
+ "net/http"
+ "server/logic"
+ "server/model"
+ "strconv"
+ "strings"
+)
+
+const (
+ StatusOk = "ok"
+ StatusFailed = "failed"
+)
+
+// Index 首页数据
+func Index(c *gin.Context) {
+ // 获取首页所需数据
+ data := logic.IL.IndexPage()
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": data,
+ })
+}
+
+// CategoriesInfo 分类信息获取
+func CategoriesInfo(c *gin.Context) {
+ data := logic.IL.GetCategoryInfo()
+
+ if data == nil {
+ c.JSON(http.StatusOK, gin.H{
+ `status`: StatusFailed,
+ `message`: `暂无分类信息!!!`,
+ })
+ return
+ }
+ c.JSON(http.StatusOK, gin.H{
+ `status`: StatusOk,
+ `data`: data,
+ })
+}
+
+// FilmDetail 影片详情信息查询
+func FilmDetail(c *gin.Context) {
+ // 获取请求参数
+ id, err := strconv.Atoi(c.Query("id"))
+ if err != nil {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "请求异常,暂无影片信息!!!",
+ })
+ return
+ }
+ // 获取影片详情信息
+ detail := logic.IL.GetFilmDetail(id)
+ // 获取相关推荐影片数据
+ page := model.Page{Current: 0, PageSize: 14}
+ relateMovie := logic.IL.RelateMovie(detail, &page)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "detail": detail,
+ "relate": relateMovie,
+ },
+ })
+}
+
+// FilmPlayInfo 影视播放页数据
+func FilmPlayInfo(c *gin.Context) {
+ // 获取请求参数
+ id, err := strconv.Atoi(c.DefaultQuery("id", "0"))
+ playFrom, err := strconv.Atoi(c.DefaultQuery("playFrom", "0"))
+ episode, err := strconv.Atoi(c.DefaultQuery("episode", "0"))
+ if err != nil {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "请求异常,暂无影片信息!!!",
+ })
+ return
+ }
+ // 获取影片详情信息
+ detail := logic.IL.GetFilmDetail(id)
+ // 推荐影片信息
+ page := model.Page{Current: 0, PageSize: 14}
+ relateMovie := logic.IL.RelateMovie(detail, &page)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "detail": detail,
+ "current": detail.PlayList[playFrom][episode],
+ "currentPlayFrom": playFrom,
+ "currentEpisode": episode,
+ "relate": relateMovie,
+ },
+ })
+}
+
+// SearchFilm 通过片名模糊匹配库存中的信息
+func SearchFilm(c *gin.Context) {
+ keyword := c.DefaultQuery("keyword", "")
+ currStr := c.DefaultQuery("current", "1")
+ current, _ := strconv.Atoi(currStr)
+ page := model.Page{PageSize: 10, Current: current}
+ bl := logic.IL.SearchFilmInfo(strings.TrimSpace(keyword), &page)
+
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": bl,
+ "page": page,
+ },
+ })
+}
+
+// FilmCategory 获取指定分类的影片分页数据,
+func FilmCategory(c *gin.Context) {
+ // 1.1 首先获取Cid 二级分类id是否存在
+ cidStr := c.DefaultQuery("cid", "")
+ // 1.2 如果pid也不存在直接返回错误信息
+ pidStr := c.DefaultQuery("pid", "")
+ if pidStr == "" {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "缺少分类信息",
+ })
+ return
+ }
+ // 1.3 获取pid对应的分类信息
+ pid, _ := strconv.ParseInt(pidStr, 10, 64)
+ category := logic.IL.GetPidCategory(pid)
+
+ // 2 设置分页信息
+ currentStr := c.DefaultQuery("current", "1")
+ current, _ := strconv.Atoi(currentStr)
+ page := model.Page{PageSize: 49, Current: current}
+ // 2.1 如果不存在cid则根据Pid进行查询
+ if cidStr == "" {
+ // 2.2 如果存在pid则根据pid进行查找
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": logic.IL.GetFilmCategory(pid, "pid", &page),
+ "category": category,
+ },
+ "page": page,
+ })
+ return
+ }
+ // 2.2 如果存在cid 则根据具体的cid去查询数据
+ cid, _ := strconv.ParseInt(cidStr, 10, 64)
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusOk,
+ "data": gin.H{
+ "list": logic.IL.GetFilmCategory(cid, "cid", &page),
+ "category": category,
+ },
+ "page": page,
+ })
+}
diff --git a/server/controller/SpiderController.go b/server/controller/SpiderController.go
new file mode 100644
index 0000000..a232c52
--- /dev/null
+++ b/server/controller/SpiderController.go
@@ -0,0 +1,46 @@
+package controller
+
+import (
+ "github.com/gin-gonic/gin"
+ "log"
+ "net/http"
+ "server/config"
+ "server/model"
+ "server/plugin/spider"
+)
+
+// SpiderRe 数据清零重开
+func SpiderRe(c *gin.Context) {
+ // 获取指令参数
+ cip := c.Query("cipher")
+ if cip != config.SpiderCipher {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "指令错误无法进行此操作",
+ })
+ return
+ }
+ // 如果指令正确,则执行重制
+ spider.StartSpiderRe()
+}
+
+// FixFilmDetail 修复因网络异常造成的影片详情数据丢失
+func FixFilmDetail(c *gin.Context) {
+ // 获取指令参数
+ cip := c.Query("cipher")
+ if cip != config.SpiderCipher {
+ c.JSON(http.StatusOK, gin.H{
+ "status": StatusFailed,
+ "message": "指令错误无法进行此操作",
+ })
+ return
+ }
+ // 如果指令正确,则执行详情数据获取
+ spider.AllMovieInfo()
+ log.Println("FilmDetail 重制完成!!!")
+ // 先截断表中的数据
+ model.TunCateSearchTable()
+ // 重新扫描完整的信息到mysql中
+ spider.SearchInfoToMdb()
+ log.Println("SearchInfo 重制完成!!!")
+}
diff --git a/server/go.mod b/server/go.mod
new file mode 100644
index 0000000..ead662b
--- /dev/null
+++ b/server/go.mod
@@ -0,0 +1,55 @@
+module server
+
+go 1.20
+
+require (
+ github.com/gin-gonic/gin v1.9.0
+ github.com/gocolly/colly/v2 v2.1.0
+ github.com/redis/go-redis/v9 v9.0.2
+ github.com/robfig/cron/v3 v3.0.0
+ gorm.io/driver/mysql v1.4.7
+ gorm.io/gorm v1.24.6
+)
+
+require (
+ github.com/PuerkitoBio/goquery v1.5.1 // indirect
+ github.com/andybalholm/cascadia v1.2.0 // indirect
+ github.com/antchfx/htmlquery v1.2.3 // indirect
+ github.com/antchfx/xmlquery v1.2.4 // indirect
+ github.com/antchfx/xpath v1.1.8 // indirect
+ github.com/bytedance/sonic v1.8.5 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
+ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+ github.com/gin-contrib/sse v0.1.0 // indirect
+ github.com/go-playground/locales v0.14.1 // indirect
+ github.com/go-playground/universal-translator v0.18.1 // indirect
+ github.com/go-playground/validator/v10 v10.12.0 // indirect
+ github.com/go-sql-driver/mysql v1.7.0 // indirect
+ github.com/gobwas/glob v0.2.3 // indirect
+ github.com/goccy/go-json v0.10.2 // indirect
+ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
+ github.com/golang/protobuf v1.5.0 // indirect
+ github.com/jinzhu/inflection v1.0.0 // indirect
+ github.com/jinzhu/now v1.1.5 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/kennygrant/sanitize v1.2.4 // indirect
+ github.com/klauspost/cpuid/v2 v2.2.4 // indirect
+ github.com/leodido/go-urn v1.2.2 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.7 // indirect
+ github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
+ github.com/temoto/robotstxt v1.1.1 // indirect
+ github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
+ github.com/ugorji/go/codec v1.2.11 // indirect
+ golang.org/x/arch v0.3.0 // indirect
+ golang.org/x/crypto v0.7.0 // indirect
+ golang.org/x/net v0.8.0 // indirect
+ golang.org/x/sys v0.6.0 // indirect
+ golang.org/x/text v0.8.0 // indirect
+ google.golang.org/appengine v1.6.6 // indirect
+ google.golang.org/protobuf v1.30.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
diff --git a/server/go.sum b/server/go.sum
new file mode 100644
index 0000000..ade6084
--- /dev/null
+++ b/server/go.sum
@@ -0,0 +1,209 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE=
+github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
+github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
+github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
+github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
+github.com/antchfx/htmlquery v1.2.3 h1:sP3NFDneHx2stfNXCKbhHFo8XgNjCACnU/4AO5gWz6M=
+github.com/antchfx/htmlquery v1.2.3/go.mod h1:B0ABL+F5irhhMWg54ymEZinzMSi0Kt3I2if0BLYa3V0=
+github.com/antchfx/xmlquery v1.2.4 h1:T/SH1bYdzdjTMoz2RgsfVKbM5uWh3gjDYYepFqQmFv4=
+github.com/antchfx/xmlquery v1.2.4/go.mod h1:KQQuESaxSlqugE2ZBcM/qn+ebIpt+d+4Xx7YcSGAIrM=
+github.com/antchfx/xpath v1.1.6/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
+github.com/antchfx/xpath v1.1.8 h1:PcL6bIX42Px5usSx6xRYw/wjB3wYGkj0MJ9MBzEKVgk=
+github.com/antchfx/xpath v1.1.8/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk=
+github.com/bsm/ginkgo/v2 v2.5.0 h1:aOAnND1T40wEdAtkGSkvSICWeQ8L3UASX7YVCqQx+eQ=
+github.com/bsm/gomega v1.20.0 h1:JhAwLmtRzXFTx2AkALSLa8ijZafntmhSoU63Ok18Uq8=
+github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
+github.com/bytedance/sonic v1.8.5 h1:kjX0/vo5acEQ/sinD/18SkA/lDDUk23F0RcaHvI7omc=
+github.com/bytedance/sonic v1.8.5/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams=
+github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
+github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
+github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
+github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
+github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k=
+github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
+github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
+github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
+github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
+github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
+github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI=
+github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA=
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
+github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
+github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
+github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA=
+github.com/gocolly/colly/v2 v2.1.0 h1:k0DuZkDoCsx51bKpRJNEmcxcp+W5N8ziuwGaSDuFoGs=
+github.com/gocolly/colly/v2 v2.1.0/go.mod h1:I2MuhsLjQ+Ex+IzK3afNS8/1qP3AedHOusRPcRdC5o0=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/jawher/mow.cli v1.1.0/go.mod h1:aNaQlc7ozF3vw6IJ2dHjp2ZFiA4ozMIYY6PyuRJwlUg=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
+github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
+github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
+github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
+github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
+github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
+github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
+github.com/leodido/go-urn v1.2.2 h1:7z68G0FCGvDk646jz1AelTYNYWrTNm0bEcFAo147wt4=
+github.com/leodido/go-urn v1.2.2/go.mod h1:kUaIbLZWttglzwNuG0pgsh5vuV6u2YcGBYz1hIPjtOQ=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
+github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
+github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/redis/go-redis/v9 v9.0.2 h1:BA426Zqe/7r56kCcvxYLWe1mkaz71LKF77GwgFzSxfE=
+github.com/redis/go-redis/v9 v9.0.2/go.mod h1:/xDTe9EF1LM61hek62Poq2nzQSGj0xSrEtEHbBQevps=
+github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E=
+github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
+github.com/rwtodd/Go.Sed v0.0.0-20210816025313-55464686f9ef/go.mod h1:8AEUvGVi2uQ5b24BIhcr0GCcpd/RNAFWaN2CJFrWIIQ=
+github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
+github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA=
+github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
+github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
+github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
+github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
+github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
+golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k=
+golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
+golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
+golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
+google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
+google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
+gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
+gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
+gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s=
+gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
diff --git a/server/logic/IndexLogic.go b/server/logic/IndexLogic.go
new file mode 100644
index 0000000..ea04db5
--- /dev/null
+++ b/server/logic/IndexLogic.go
@@ -0,0 +1,137 @@
+package logic
+
+import (
+ "fmt"
+ "github.com/gin-gonic/gin"
+ "server/config"
+ "server/model"
+ "server/plugin/db"
+)
+
+/*
+*
+ IndexController数据处理
+*/
+
+type IndexLogic struct {
+}
+
+var IL *IndexLogic
+
+// IndexPage 首页数据处理
+func (i *IndexLogic) IndexPage() gin.H {
+ Info := gin.H{}
+ // 首页分类数据处理
+
+ // 1. 导航分类数据处理, 只提供 电影 电视剧 综艺 动漫 四大顶级分类和其子分类
+ tree := model.CategoryTree{Category: &model.Category{Id: 0, Name: "分类信息"}}
+ sysTree := model.GetCategoryTree()
+ // 由于采集源数据格式不一,因此采用名称匹配
+ for _, c := range sysTree.Children {
+ switch c.Category.Name {
+ case "电影", "电影片", "连续剧", "电视剧", "综艺", "综艺片", "动漫", "动漫片":
+ tree.Children = append(tree.Children, c)
+ }
+ }
+ Info["category"] = tree
+ // 2. 提供用于首页展示的顶级分类影片信息, 每分类 14条数据
+ var list []gin.H
+ for _, c := range tree.Children {
+ page := model.Page{PageSize: 14, Current: 1}
+ movies := model.GetMovieListByPid(c.Id, &page)
+ item := gin.H{"nav": c, "movies": movies}
+ list = append(list, item)
+ }
+ Info["content"] = list
+
+ return Info
+}
+
+// GetFilmDetail 影片详情信息页面处理
+func (i *IndexLogic) GetFilmDetail(id int) model.MovieDetail {
+ // 通过Id 获取影片search信息
+ search := model.SearchInfo{}
+ db.Mdb.Where("mid", id).First(&search)
+ // 获取redis中的完整影视信息 MovieDetail:Cid11:Id24676
+ movieDetail := model.GetDetailByKey(fmt.Sprintf(config.MovieDetailKey, search.Cid, search.Mid))
+ return movieDetail
+}
+
+// GetCategoryInfo 分类信息获取, 组装导航栏需要的信息
+func (i *IndexLogic) GetCategoryInfo() gin.H {
+ // 组装nav导航所需的信息
+ nav := gin.H{}
+ // 1.获取所有分类信息
+ tree := model.GetCategoryTree()
+ // 2. 过滤出主页四大分类的tree信息
+ for _, t := range tree.Children {
+ switch t.Category.Name {
+ case "动漫", "动漫片":
+ nav["cartoon"] = t
+ case "电影", "电影片":
+ nav["film"] = t
+ case "连续剧", "电视剧":
+ nav["tv"] = t
+ case "综艺", "综艺片":
+ nav["variety"] = t
+ }
+ }
+ // 获取所有的分类
+ return nav
+}
+
+// SearchFilmInfo 获取关键字匹配的影片信息
+func (i *IndexLogic) SearchFilmInfo(key string, page *model.Page) []model.MovieBasicInfo {
+ // 1. 从mysql中获取满足条件的数据, 每页10条
+ sl := model.SearchFilmKeyword(key, page)
+ // 2. 获取redis中的basicMovieInfo信息
+ var bl []model.MovieBasicInfo
+ for _, s := range sl {
+ bl = append(bl, model.GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, s.Cid, s.Mid)))
+ }
+ return bl
+}
+
+// GetFilmCategory 根据Pid或Cid获取指定的分页数据
+func (i *IndexLogic) GetFilmCategory(id int64, idType string, page *model.Page) []model.MovieBasicInfo {
+ // 1. 根据不同类型进不同的查找
+ var basicList []model.MovieBasicInfo
+ switch idType {
+ case "pid":
+ basicList = model.GetMovieListByPid(id, page)
+ case "cid":
+ basicList = model.GetMovieListByCid(id, page)
+ }
+ return basicList
+}
+
+// GetPidCategory 获取pid对应的分类信息
+func (i *IndexLogic) GetPidCategory(pid int64) *model.CategoryTree {
+ tree := model.GetCategoryTree()
+ for _, t := range tree.Children {
+ if t.Id == pid {
+ return t
+ }
+ }
+ return nil
+}
+
+// RelateMovie 根据当前影片信息匹配相关的影片
+func (i *IndexLogic) RelateMovie(detail model.MovieDetail, page *model.Page) []model.MovieBasicInfo {
+ /*
+ 根据当前影片信息匹配相关的影片
+ 1. 分类Cid,
+ 2. 影片名Name
+ 3. 剧情内容标签class_tag
+ 4. 地区 area
+ 5. 语言 Language
+ */
+ search := model.SearchInfo{
+ Cid: detail.Cid,
+ Name: detail.Name,
+ ClassTag: detail.ClassTag,
+ Area: detail.Area,
+ Language: detail.Language,
+ }
+ return model.GetRelateMovieBasicInfo(search, page)
+}
diff --git a/server/main.go b/server/main.go
new file mode 100644
index 0000000..d233cb5
--- /dev/null
+++ b/server/main.go
@@ -0,0 +1,47 @@
+package main
+
+import (
+ "server/model"
+ "server/plugin/db"
+ "server/plugin/spider"
+ "server/router"
+ "time"
+)
+
+func init() {
+ // 执行初始化前等待30s , 让mysql服务完成初始化指令
+ time.Sleep(time.Second * 30)
+ //初始化redis客户端
+ err := db.InitRedisConn()
+ if err != nil {
+ panic(err)
+ }
+ // 初始化mysql
+ err = db.InitMysql()
+ if err != nil {
+ panic(err)
+ }
+}
+func main() {
+ start()
+}
+
+func start() {
+ // 开启前先判断是否需要执行Spider
+ ExecSpider()
+ // web服务启动后开启定时任务, 用于定期更新资源
+ spider.RegularUpdateMovie()
+ // 开启路由监听
+ r := router.SetupRouter()
+ _ = r.Run(`:3601`)
+
+}
+
+func ExecSpider() {
+ // 判断分类信息是否存在
+ isStart := model.ExistsCategoryTree()
+ // 如果分类信息不存在则进行一次完整爬取
+ if !isStart {
+ spider.StartSpider()
+ }
+}
diff --git a/server/model/Categories.go b/server/model/Categories.go
new file mode 100644
index 0000000..87f837f
--- /dev/null
+++ b/server/model/Categories.go
@@ -0,0 +1,43 @@
+package model
+
+import (
+ "encoding/json"
+ "log"
+ "server/config"
+ "server/plugin/db"
+)
+
+// Category 分类信息
+type Category struct {
+ Id int64 `json:"id"` // 分类ID
+ Pid int64 `json:"pid"` // 父级分类ID
+ Name string `json:"name"` // 分类名称
+}
+
+// CategoryTree 分类信息树形结构
+type CategoryTree struct {
+ *Category
+ Children []*CategoryTree `json:"children"` // 子分类信息
+}
+
+// SaveCategoryTree 保存影片分类信息
+func SaveCategoryTree(tree string) error {
+ return db.Rdb.Set(db.Cxt, config.CategoryTreeKey, tree, config.CategoryTreeExpired).Err()
+}
+
+// GetCategoryTree 获取影片分类信息
+func GetCategoryTree() CategoryTree {
+ data := db.Rdb.Get(db.Cxt, config.CategoryTreeKey).Val()
+ tree := CategoryTree{}
+ _ = json.Unmarshal([]byte(data), &tree)
+ return tree
+}
+
+// ExistsCategoryTree 查询分类信息是否存在
+func ExistsCategoryTree() bool {
+ exists, err := db.Rdb.Exists(db.Cxt, config.CategoryTreeKey).Result()
+ if err != nil {
+ log.Println("ExistsCategoryTree Error", err)
+ }
+ return exists == 1
+}
diff --git a/server/model/LZJson.go b/server/model/LZJson.go
new file mode 100644
index 0000000..e0b1a18
--- /dev/null
+++ b/server/model/LZJson.go
@@ -0,0 +1,81 @@
+package model
+
+/*
+量子资源JSON解析
+*/
+
+// ClassInfo class 分类数据
+type ClassInfo struct {
+ Id int64 `json:"type_id"` //分类ID
+ Pid int64 `json:"type_pid"` //上级分类ID
+ Name string `json:"type_name"` //分类名称
+}
+
+// MovieInfo 影片数据
+type MovieInfo struct {
+ Id int64 `json:"vod_id"` // 影片ID
+ Name string `json:"vod_name"` // 影片名
+ Cid int64 `json:"type_id"` // 所属分类ID
+ CName string `json:"type_name"` // 所属分类名称
+ EnName string `json:"vod_en"` // 英文片名
+ Time string `json:"vod_time"` // 更新时间
+ Remarks string `json:"vod_remarks"` // 备注 | 清晰度
+ PlayFrom string `json:"vod_play_from"` // 播放来源
+}
+
+// MovieListInfo 影视列表响应数据
+type MovieListInfo struct {
+ Code int64 `json:"code"`
+ Msg string `json:"msg"`
+ Page string `json:"page"`
+ PageCount int64 `json:"pagecount"`
+ Limit string `json:"limit"`
+ Total int64 `json:"total"`
+ List []MovieInfo `json:"list"`
+ Class []ClassInfo `json:"class"`
+}
+
+// MovieDetailInfo 影片详情数据 (只保留需要的部分)
+type MovieDetailInfo struct {
+ Id int64 `json:"vod_id"` //影片Id
+ Cid int64 `json:"type_id"` //分类ID
+ Pid int64 `json:"type_id_1"` //一级分类ID
+ Name string `json:"vod_name"` //片名
+ SubTitle string `json:"vod_sub"` //子标题
+ CName string `json:"type_name"` //分类名称
+ EnName string `json:"vod_en"` //英文名
+ Initial string `json:"vod_letter"` //首字母
+ ClassTag string `json:"vod_class"` //分类标签
+ Pic string `json:"vod_pic"` //简介图片
+ Actor string `json:"vod_actor"` //主演
+ Director string `json:"vod_director"` //导演
+ Writer string `json:"vod_writer"` //作者
+ Blurb string `json:"vod_blurb"` //简介, 残缺,不建议使用
+ Remarks string `json:"vod_remarks"` // 更新情况
+ PubDate string `json:"vod_pubdate"` //上映时间
+ Area string `json:"vod_area"` // 地区
+ Language string `json:"vod_lang"` //语言
+ Year string `json:"vod_year"` //年份
+ State string `json:"vod_state"` //影片状态 正片|预告...
+ UpdateTime string `json:"vod_time"` //更新时间
+ AddTime int64 `json:"vod_time_add"` //资源添加时间戳
+ DbId int64 `json:"vod_douban_id"` //豆瓣id
+ DbScore string `json:"vod_douban_score"` // 豆瓣评分
+ Content string `json:"vod_content"` //内容简介
+ PlayFrom string `json:"vod_play_from"` // 播放来源
+ PlaySeparator string `json:"vod_play_note"` // 播放信息分隔符
+ PlayUrl string `json:"vod_play_url"` //播放地址url
+ DownFrom string `json:"vod_down_from"` //下载来源 例: http
+ DownUrl string `json:"vod_down_url"` // 下载url地址
+}
+
+// DetailListInfo 影视详情信息
+type DetailListInfo struct {
+ Code int64 `json:"code"`
+ Msg string `json:"msg"`
+ Page int64 `json:"page"`
+ PageCount int64 `json:"pagecount"`
+ Limit string `json:"limit"`
+ Total int64 `json:"total"`
+ List []MovieDetailInfo `json:"list"`
+}
diff --git a/server/model/Movies.go b/server/model/Movies.go
new file mode 100644
index 0000000..fea9e00
--- /dev/null
+++ b/server/model/Movies.go
@@ -0,0 +1,332 @@
+package model
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/redis/go-redis/v9"
+ "log"
+ "server/config"
+ "server/plugin/db"
+ "strconv"
+ "strings"
+ "time"
+)
+
+// Movie 影片基本信息
+type Movie struct {
+ Id int64 `json:"id"` // 影片ID
+ Name string `json:"name"` // 影片名
+ Cid int64 `json:"cid"` // 所属分类ID
+ CName string `json:"CName"` // 所属分类名称
+ EnName string `json:"enName"` // 英文片名
+ Time string `json:"time"` // 更新时间
+ Remarks string `json:"remarks"` // 备注 | 清晰度
+ PlayFrom string `json:"playFrom"` // 播放来源
+}
+
+// MovieDescriptor 影片详情介绍信息
+type MovieDescriptor struct {
+ SubTitle string `json:"subTitle"` //子标题
+ CName string `json:"cName"` //分类名称
+ EnName string `json:"enName"` //英文名
+ Initial string `json:"initial"` //首字母
+ ClassTag string `json:"classTag"` //分类标签
+ Actor string `json:"actor"` //主演
+ Director string `json:"director"` //导演
+ Writer string `json:"writer"` //作者
+ Blurb string `json:"blurb"` //简介, 残缺,不建议使用
+ Remarks string `json:"remarks"` // 更新情况
+ ReleaseDate string `json:"releaseDate"` //上映时间
+ Area string `json:"area"` // 地区
+ Language string `json:"language"` //语言
+ Year string `json:"year"` //年份
+ State string `json:"state"` //影片状态 正片|预告...
+ UpdateTime string `json:"updateTime"` //更新时间
+ AddTime int64 `json:"addTime"` //资源添加时间戳
+ DbId int64 `json:"dbId"` //豆瓣id
+ DbScore string `json:"dbScore"` // 豆瓣评分
+ Content string `json:"content"` //内容简介
+}
+
+// MovieBasicInfo 影片基本信息
+type MovieBasicInfo struct {
+ Id int64 `json:"id"` //影片Id
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //一级分类ID
+ Name string `json:"name"` //片名
+ SubTitle string `json:"subTitle"` //子标题
+ CName string `json:"cName"` //分类名称
+ State string `json:"state"` //影片状态 正片|预告...
+ Picture string `json:"picture"` //简介图片
+ Actor string `json:"actor"` //主演
+ Director string `json:"director"` //导演
+ Blurb string `json:"blurb"` //简介, 不完整
+ Remarks string `json:"remarks"` // 更新情况
+ Area string `json:"area"` // 地区
+ Year string `json:"year"` //年份
+}
+
+// MovieUrlInfo 影视资源url信息
+type MovieUrlInfo struct {
+ Episode string `json:"episode"` // 集数
+ Link string `json:"link"` // 播放地址
+}
+
+// MovieDetail 影片详情信息
+type MovieDetail struct {
+ Id int64 `json:"id"` //影片Id
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //一级分类ID
+ Name string `json:"name"` //片名
+ Picture string `json:"picture"` //简介图片
+ PlayFrom []string `json:"playFrom"` // 播放来源
+ DownFrom string `json:"DownFrom"` //下载来源 例: http
+ //PlaySeparator string `json:"playSeparator"` // 播放信息分隔符
+ PlayList [][]MovieUrlInfo `json:"playList"` //播放地址url
+ DownloadList [][]MovieUrlInfo `json:"downloadList"` // 下载url地址
+ MovieDescriptor `json:"descriptor"` //影片描述信息
+}
+
+// SaveMoves 保存影片分页请求list
+func SaveMoves(list []Movie) (err error) {
+ // 整合数据
+ for _, m := range list {
+ //score, _ := time.ParseInLocation(time.DateTime, m.Time, time.Local)
+ movie, _ := json.Marshal(m)
+ // 以Cid为目录为集合进行存储, 便于后续搜索, 以影片id为分值进行存储 例 MovieList:Cid%d
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf(config.MovieListInfoKey, m.Cid), redis.Z{Score: float64(m.Id), Member: movie}).Err()
+ }
+ return err
+}
+
+// AllMovieInfoKey 获取redis中所有的影视列表信息key MovieList:Cid
+func AllMovieInfoKey() []string {
+ return db.Rdb.Keys(db.Cxt, fmt.Sprint("MovieList:Cid*")).Val()
+}
+
+// GetMovieListByKey 获取指定分类的影片列表数据
+func GetMovieListByKey(key string) []string {
+ return db.Rdb.ZRange(db.Cxt, key, 0, -1).Val()
+}
+
+// SaveDetails 保存影片详情信息到redis中 格式: MovieDetail:Cid?:Id?
+func SaveDetails(list []MovieDetail) (err error) {
+ // 遍历list中的信息
+ for _, detail := range list {
+ // 序列化影片详情信息
+ data, _ := json.Marshal(detail)
+ // 1. 原使用Zset存储, 但是不便于单个检索 db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Cid%d", config.MovieDetailKey, detail.Cid), redis.Z{Score: float64(detail.Id), Member: member}).Err()
+ // 改为普通 k v 存储, k-> id关键字, v json序列化的结果, //只保留十天, 没周更新一次
+ err = db.Rdb.Set(db.Cxt, fmt.Sprintf(config.MovieDetailKey, detail.Cid, detail.Id), data, config.CategoryTreeExpired).Err()
+ // 2. 同步保存简略信息到redis中
+ SaveMovieBasicInfo(detail)
+ // 3. 保存Search检索信息到redis
+ if err == nil {
+ // 转换 detail信息
+ searchInfo := ConvertSearchInfo(detail)
+ // 放弃redis进行检索, 多条件处理不方便
+ //err = AddSearchInfo(searchInfo)
+ // 只存储用于检索对应影片的关键字信息
+ SearchKeyword(searchInfo)
+ }
+
+ }
+ // 保存一份search信息到mysql, 批量存储
+ BatchSaveSearchInfo(list)
+ return err
+}
+
+// SaveMovieBasicInfo 摘取影片的详情部分信息转存为影视基本信息
+func SaveMovieBasicInfo(detail MovieDetail) {
+ basicInfo := MovieBasicInfo{
+ Id: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ SubTitle: detail.SubTitle,
+ CName: detail.CName,
+ State: detail.State,
+ Picture: detail.Picture,
+ Actor: detail.Actor,
+ Director: detail.Director,
+ Blurb: detail.Blurb,
+ Remarks: detail.Remarks,
+ Area: detail.Area,
+ Year: detail.Year,
+ }
+ data, _ := json.Marshal(basicInfo)
+ _ = db.Rdb.Set(db.Cxt, fmt.Sprintf(config.MovieBasicInfoKey, detail.Cid, detail.Id), data, config.CategoryTreeExpired).Err()
+}
+
+// AddSearchInfo 将影片关键字信息整合后存入search 集合中
+func AddSearchInfo(searchInfo SearchInfo) (err error) {
+ // 片名 Name 分类 CName 类别标签 classTag 地区 Area 语言 Language 年份 Year 首字母 Initial, 排序
+ data, _ := json.Marshal(searchInfo)
+ // 时间排序 score -->时间戳 DbId 排序 --> 热度, 评分排序 DbScore
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchTimeListKey, searchInfo.Pid), redis.Z{Score: float64(searchInfo.Time), Member: data}).Err()
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchScoreListKey, searchInfo.Pid), redis.Z{Score: searchInfo.Score, Member: data}).Err()
+ err = db.Rdb.ZAdd(db.Cxt, fmt.Sprintf("%s:Pid%d", config.SearchHeatListKey, searchInfo.Pid), redis.Z{Score: float64(searchInfo.Rank), Member: data}).Err()
+ // 添加搜索关键字信息
+ SearchKeyword(searchInfo)
+ return
+}
+
+// SearchKeyword 设置search关键字集合
+func SearchKeyword(search SearchInfo) {
+ // 首先获取redis中的search 关键字信息
+ key := fmt.Sprintf("%s:Pid%d", config.SearchKeys, search.Pid)
+ keyword := db.Rdb.HGetAll(db.Cxt, key).Val()
+ if keyword["Year"] == "" {
+ currentYear := time.Now().Year()
+ year := ""
+ for i := 0; i < 12; i++ {
+ // 提供当前年份前推十二年的搜索
+ year = fmt.Sprintf("%s,%d", year, currentYear-i)
+ }
+ initial := ""
+ for i := 65; i <= 90; i++ {
+ initial = fmt.Sprintf("%s,%c", initial, i)
+ }
+ keyword = map[string]string{
+ //"Name": "",
+ "Category": "",
+ "Tag": "",
+ "Area": "",
+ "Language": "",
+ "Year": strings.Trim(year, ","),
+ "Initial": strings.Trim(initial, ","),
+ "Sort": "Time,Db,Score", // 默认,一般不修改
+ }
+ }
+ // 分类标签处理
+ if !strings.Contains(keyword["Category"], search.CName) {
+ keyword["Category"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Category"], search.CName), ",")
+ }
+ // 影视内容分类处理
+ if strings.Contains(search.ClassTag, "/") {
+ for _, t := range strings.Split(search.ClassTag, "/") {
+ if !strings.Contains(keyword["Tag"], t) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], t), ",")
+ }
+ }
+ } else if strings.Contains(search.ClassTag, ",") {
+ for _, t := range strings.Split(search.ClassTag, ",") {
+ if !strings.Contains(keyword["Tag"], t) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], t), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Tag"], search.ClassTag) {
+ keyword["Tag"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Tag"], search.ClassTag), ",")
+ }
+ }
+ // 如果地区中包含 / 分隔符 则先进行切分处理
+ if strings.Contains(search.Area, "/") {
+ for _, s := range strings.Split(search.Area, "/") {
+ if !strings.Contains(keyword["Area"], strings.TrimSpace(s)) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], s), ",")
+ }
+ }
+ } else if strings.Contains(search.Area, ",") {
+ for _, s := range strings.Split(search.Area, ",") {
+ if !strings.Contains(keyword["Area"], strings.TrimSpace(s)) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], s), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Area"], search.Area) {
+ keyword["Area"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Area"], search.Area), ",")
+ }
+ }
+ // 语言处理
+ if strings.Contains(search.Language, "/") {
+ for _, l := range strings.Split(search.Language, "/") {
+ if !strings.Contains(keyword["Language"], l) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], l), ",")
+ }
+ }
+
+ } else if strings.Contains(search.Language, ",") {
+ for _, l := range strings.Split(search.Language, ",") {
+ if !strings.Contains(keyword["Language"], l) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], l), ",")
+ }
+ }
+ } else {
+ if !strings.Contains(keyword["Language"], search.Language) {
+ keyword["Language"] = strings.Trim(fmt.Sprintf("%s,%s", keyword["Language"], search.Language), ",")
+ }
+ }
+ _ = db.Rdb.HMSet(db.Cxt, key, keyword).Err()
+}
+
+// BatchSaveSearchInfo 批量保存Search信息
+func BatchSaveSearchInfo(list []MovieDetail) {
+ var infoList []SearchInfo
+ for _, v := range list {
+ infoList = append(infoList, ConvertSearchInfo(v))
+ }
+ // 将检索信息存入redis中做一次转存
+ RdbSaveSearchInfo(infoList)
+
+ // 废弃方案, 频繁大量入库容易引起主键冲突, 事务影响速率
+ // 批量插入时应对已存在数据进行检测, 使用mysql事务进行锁表
+ //BatchSave(infoList)
+ // 使用批量添加or更新
+ //BatchSaveOrUpdate(infoList)
+}
+
+// ConvertSearchInfo 将detail信息处理成 searchInfo
+func ConvertSearchInfo(detail MovieDetail) SearchInfo {
+ score, _ := strconv.ParseFloat(detail.DbScore, 64)
+ stamp, _ := time.ParseInLocation(time.DateTime, detail.UpdateTime, time.Local)
+ year, err := strconv.ParseInt(detail.Year, 10, 64)
+ if err != nil {
+ year = 0
+ }
+
+ return SearchInfo{
+ Mid: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ CName: detail.CName,
+ ClassTag: detail.ClassTag,
+ Area: detail.Area,
+ Language: detail.Language,
+ Year: year,
+ Initial: detail.Initial,
+ Score: score,
+ Rank: detail.DbId,
+ Time: stamp.Unix(),
+ State: detail.State,
+ Remarks: detail.Remarks,
+ // releaseDate 部分影片缺失该参数, 所以使用添加时间作为上映时间排序
+ ReleaseDate: detail.AddTime,
+ }
+}
+
+// GetBasicInfoByKey 获取Id对应的影片基本信息
+func GetBasicInfoByKey(key string) MovieBasicInfo {
+ // 反序列化得到的结果
+ data := []byte(db.Rdb.Get(db.Cxt, key).Val())
+ basic := MovieBasicInfo{}
+ _ = json.Unmarshal(data, &basic)
+ return basic
+}
+
+// GetDetailByKey 获取影片对应的详情信息
+func GetDetailByKey(key string) MovieDetail {
+ // 反序列化得到的结果
+ data := []byte(db.Rdb.Get(db.Cxt, key).Val())
+ detail := MovieDetail{}
+ _ = json.Unmarshal(data, &detail)
+ return detail
+}
+
+// SearchMovie 搜索关键字影片
+func SearchMovie() {
+ data, err := db.Rdb.ZScan(db.Cxt, "MovieList:cid30", 0, `*天使*`, config.SearchCount).Val()
+ log.Println(err)
+ fmt.Println(data)
+}
diff --git a/server/model/Search.go b/server/model/Search.go
new file mode 100644
index 0000000..bd03aa2
--- /dev/null
+++ b/server/model/Search.go
@@ -0,0 +1,291 @@
+package model
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/redis/go-redis/v9"
+ "gorm.io/gorm"
+ "log"
+ "reflect"
+ "regexp"
+ "server/config"
+ "server/plugin/db"
+ "strings"
+)
+
+// SearchInfo 存储用于检索的信息
+type SearchInfo struct {
+ gorm.Model
+ Mid int64 `json:"mid" gorm:"uniqueIndex:idx_mid"` //影片ID
+ Cid int64 `json:"cid"` //分类ID
+ Pid int64 `json:"pid"` //上级分类ID
+ Name string `json:"name"` // 片名
+ CName string `json:"CName"` // 分类名称
+ ClassTag string `json:"classTag"` //类型标签
+ Area string `json:"area"` // 地区
+ Language string `json:"language"` // 语言
+ Year int64 `json:"year"` // 年份
+ Initial string `json:"initial"` // 首字母
+ Score float64 `json:"score"` //评分
+ Time int64 `json:"time"` // 更新时间
+ Rank int64 `json:"rank"` // 热度排行id
+ State string `json:"state"` //状态 正片|预告
+ Remarks string `json:"remarks"` // 完结 | 更新至x集
+ ReleaseDate int64 `json:"releaseDate"` //上映时间 时间戳
+}
+
+// Page 分页信息结构体
+type Page struct {
+ PageSize int `json:"pageSize"` // 每页大小
+ Current int `json:"current"` // 当前页
+ PageCount int `json:"pageCount"` // 总页数
+ Total int `json:"total"` // 总记录数
+ //List []interface{} `json:"list"` // 数据
+}
+
+func (s *SearchInfo) TableName() string {
+ return "search_lz"
+ //return "search_fs"
+}
+
+// ================================= Spider 数据处理(redis) =================================
+
+// RdbSaveSearchInfo 批量保存检索信息到redis
+func RdbSaveSearchInfo(list []SearchInfo) {
+ // 1.整合一下zset数据集
+ var members []redis.Z
+ for _, s := range list {
+ member, _ := json.Marshal(s)
+ members = append(members, redis.Z{Score: float64(s.Mid), Member: member})
+ }
+ // 2.批量保存到zset集合中
+ db.Rdb.ZAdd(db.Cxt, config.SearchInfoTemp, members...)
+}
+
+// ScanSearchInfo 批量扫描处理详情检索信息, 返回检索信息列表和下次开始的游标
+func ScanSearchInfo(cursor uint64, count int64) ([]SearchInfo, uint64) {
+ // 1.从redis中批量扫描详情信息
+ list, nextCursor := db.Rdb.ZScan(db.Cxt, config.SearchInfoTemp, cursor, "*", count).Val()
+ // 2. 处理数据
+ var resList []SearchInfo
+ for i, s := range list {
+ // 3. 判断当前是否是元素
+ if i%2 == 0 {
+ info := SearchInfo{}
+ _ = json.Unmarshal([]byte(s), &info)
+ info.Model = gorm.Model{}
+ resList = append(resList, info)
+ }
+ }
+ return resList, nextCursor
+}
+
+// RemoveAll 删除所有库存数据
+func RemoveAll() {
+ // 删除redis中当前库存储的所有数据
+ db.Rdb.FlushDB(db.Cxt)
+ // 删除mysql中留存的检索表
+ var s *SearchInfo
+ db.Mdb.Exec(fmt.Sprintf(`drop table if exists %s`, s.TableName()))
+}
+
+// ================================= Spider 数据处理(mysql) =================================
+
+// CreateSearchTable 创建存储检索信息的数据表
+func CreateSearchTable() {
+ // 1. 判断表中是否存在当前表
+ isExist := db.Mdb.Migrator().HasTable(&SearchInfo{})
+ // 如果不存在则创建表
+ if !isExist {
+ err := db.Mdb.AutoMigrate(&SearchInfo{})
+ if err != nil {
+ log.Println("Create Table SearchInfo Failed: ", err)
+ }
+ }
+}
+
+// BatchSave 批量保存影片search信息
+func BatchSave(list []SearchInfo) {
+ tx := db.Mdb.Begin()
+ // 防止程序异常终止
+ defer func() {
+ if r := recover(); r != nil {
+ tx.Rollback()
+ }
+ }()
+ if err := tx.CreateInBatches(list, len(list)).Error; err != nil {
+ // 插入失败则回滚事务, 重新进行插入
+ tx.Rollback()
+ return
+ }
+ // 插入成功后输出一下成功信息
+ //log.Println("BatchSave SearchInfo Successful, Count: ", len(list))
+ tx.Commit()
+}
+
+// BatchSaveOrUpdate 判断数据库中是否存在对应mid的数据, 如果存在则更新, 否则插入
+func BatchSaveOrUpdate(list []SearchInfo) {
+ tx := db.Mdb.Begin()
+ // 失败则回滚事务
+ //defer func() {
+ // if r := recover(); r != nil {
+ // tx.Rollback()
+ // }
+ //}()
+ for _, info := range list {
+ var count int64
+ // 通过当前影片id 对应的记录数
+ tx.Model(&SearchInfo{}).Where("mid", info.Mid).Count(&count)
+ // 如果存在对应数据则进行更新, 否则进行删除
+ if count > 0 {
+ // 记录已经存在则执行更新部分内容
+ err := tx.Model(&SearchInfo{}).Where("mid", info.Mid).Updates(SearchInfo{Time: info.Time, Rank: info.Rank, State: info.State,
+ Remarks: info.Remarks, Score: info.Score, ReleaseDate: info.ReleaseDate}).Error
+ if err != nil {
+ tx.Rollback()
+ }
+ } else {
+ // 执行插入操作
+ if err := tx.Create(&info).Error; err != nil {
+ tx.Rollback()
+ }
+ }
+ }
+ // 提交事务
+ tx.Commit()
+}
+
+// SaveSearchData 添加影片检索信息
+func SaveSearchData(s SearchInfo) {
+ // 先查询数据库中是否存在对应记录
+ isExist := SearchMovieInfo(s.Mid)
+ // 如果不存在对应记录则 保存当前记录
+ if !isExist {
+ db.Mdb.Create(&s)
+ }
+}
+
+// SearchMovieInfo 通过Mid查询符合条件的数据
+func SearchMovieInfo(mid int64) bool {
+ search := SearchInfo{}
+ db.Mdb.Where("mid", mid).First(&search)
+ // reflect.DeepEqual(a, A{})
+ return !reflect.DeepEqual(search, SearchInfo{})
+}
+
+// TunCateSearchTable 截断SearchInfo数据表
+func TunCateSearchTable() {
+ var searchInfo *SearchInfo
+ err := db.Mdb.Exec(fmt.Sprint("TRUNCATE TABLE ", searchInfo.TableName())).Error
+ if err != nil {
+ log.Println("TRUNCATE TABLE Error: ", err)
+ }
+}
+
+// ================================= API 数据接口信息处理 =================================
+
+// GetMovieListByPid 通过Pid 分类ID 获取对应影片的数据信息
+func GetMovieListByPid(pid int64, page *Page) []MovieBasicInfo {
+ // 返回分页参数
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("pid", pid).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 进行具体的信息查询
+ var s []SearchInfo
+ if err := db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).Where("pid", pid).Order("year DESC, time DESC").Find(&s).Error; err != nil {
+ log.Println(err)
+ return nil
+ }
+ // 通过影片ID去redis中获取id对应数据信息
+ var list []MovieBasicInfo
+ for _, v := range s {
+ // 通过key搜索指定的影片信息 , MovieDetail:Cid6:Id15441
+ list = append(list, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, v.Cid, v.Mid)))
+ }
+ return list
+}
+
+// SearchFilmKeyword 通过关键字搜索库存中满足条件的影片名
+func SearchFilmKeyword(keyword string, page *Page) []SearchInfo {
+ var searchList []SearchInfo
+ // 1. 先统计搜索满足条件的数据量
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("name LIKE ?", fmt.Sprint(`%`, keyword, `%`)).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 2. 获取满足条件的数据
+ db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).
+ Where("name LIKE ?", fmt.Sprint(`%`, keyword, `%`)).Order("year DESC, time DESC").Find(&searchList)
+ return searchList
+}
+
+// GetMovieListByCid 通过Cid查找对应的影片分页数据, 不适合GetMovieListByPid 糅合
+func GetMovieListByCid(cid int64, page *Page) []MovieBasicInfo {
+ // 返回分页参数
+ var count int64
+ db.Mdb.Model(&SearchInfo{}).Where("cid", cid).Count(&count)
+ page.Total = int(count)
+ page.PageCount = int((page.Total + page.PageSize - 1) / page.PageSize)
+ // 进行具体的信息查询
+ var s []SearchInfo
+ if err := db.Mdb.Limit(page.PageSize).Offset((page.Current-1)*page.PageSize).Where("cid", cid).Order("year DESC, time DESC").Find(&s).Error; err != nil {
+ log.Println(err)
+ return nil
+ }
+ // 通过影片ID去redis中获取id对应数据信息
+ var list []MovieBasicInfo
+ for _, v := range s {
+ // 通过key搜索指定的影片信息 , MovieDetail:Cid6:Id15441
+ list = append(list, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, v.Cid, v.Mid)))
+ }
+ return list
+}
+
+// GetRelateMovieBasicInfo GetRelateMovie 根据SearchInfo获取相关影片
+func GetRelateMovieBasicInfo(search SearchInfo, page *Page) []MovieBasicInfo {
+ /*
+ 根据当前影片信息匹配相关的影片
+ 1. 分类Cid,
+ 2. 如果影片名称含有第x季 则根据影片名进行模糊匹配
+ 3. class_tag 剧情内容匹配, 切分后使用 or 进行匹配
+ 4. area 地区
+ 5. 语言 Language
+ */
+
+ // sql 拼接查询条件
+ sql := ""
+ // 优先进行名称相似匹配
+ re := regexp.MustCompile("第.{1,3}季")
+ if re.MatchString(search.Name) {
+ search.Name = re.ReplaceAllString(search.Name, "")
+ sql = fmt.Sprintf(`select * from %s where name LIKE "%%%s%%" union`, search.TableName(), search.Name)
+ }
+ // 执行后续匹配内容
+ //sql = fmt.Sprintf(`%s select * from %s where cid=%d AND area="%s" AND language="%s" AND`, sql, search.TableName(), search.Cid, search.Area, search.Language)
+
+ // 地区限制取消, 过滤掉的影片太多
+ sql = fmt.Sprintf(`%s select * from %s where cid=%d AND language="%s" AND`, sql, search.TableName(), search.Cid, search.Language)
+ if strings.Contains(search.ClassTag, ",") {
+ s := "("
+ for _, t := range strings.Split(search.ClassTag, ",") {
+ s = fmt.Sprintf(`%s class_tag = "%s" OR`, s, t)
+ }
+ sql = fmt.Sprintf("%s %s)", sql, strings.TrimSuffix(s, "OR"))
+ } else {
+ sql = fmt.Sprintf(`%s class_tag = "%s"`, sql, search.ClassTag)
+ }
+ // 条件拼接完成后加上limit参数
+ sql = fmt.Sprintf("(%s) limit %d,%d", sql, page.Current, page.PageSize)
+ // 执行sql
+ list := []SearchInfo{}
+ db.Mdb.Raw(sql).Scan(&list)
+ // 根据list 获取对应的BasicInfo
+ var basicList []MovieBasicInfo
+ for _, s := range list {
+ // 通过key获取对应的影片基本数据
+ basicList = append(basicList, GetBasicInfoByKey(fmt.Sprintf(config.MovieBasicInfoKey, s.Cid, s.Mid)))
+ }
+
+ return basicList
+}
diff --git a/server/plugin/common/ProcessCategory.go b/server/plugin/common/ProcessCategory.go
new file mode 100644
index 0000000..2546f29
--- /dev/null
+++ b/server/plugin/common/ProcessCategory.go
@@ -0,0 +1,38 @@
+package common
+
+import (
+ "server/model"
+)
+
+// =================Spider数据处理=======================
+
+// CategoryTree 组装树形菜单
+func CategoryTree(list []model.ClassInfo) *model.CategoryTree {
+ // 遍历所有分类进行树形结构组装
+ tree := &model.CategoryTree{Category: &model.Category{Id: 0, Pid: -1, Name: "分类信息"}}
+ temp := make(map[int64]*model.CategoryTree)
+ temp[tree.Id] = tree
+
+ for _, c := range list {
+ // 判断当前节点ID是否存在于 temp中
+ category, ok := temp[c.Id]
+ if ok {
+ // 将当前节点信息保存
+ category.Category = &model.Category{Id: c.Id, Pid: c.Pid, Name: c.Name}
+ } else {
+ // 如果不存在则将当前分类存放到 temp中
+ category = &model.CategoryTree{Category: &model.Category{Id: c.Id, Pid: c.Pid, Name: c.Name}}
+ temp[c.Id] = category
+ }
+ // 根据 pid获取父节点信息
+ parent, ok := temp[category.Pid]
+ if !ok {
+ // 如果不存在父节点存在, 则将父节点存放到temp中
+ temp[c.Pid] = parent
+ }
+ // 将当前节点存放到父节点的Children中
+ parent.Children = append(parent.Children, category)
+ }
+
+ return tree
+}
diff --git a/server/plugin/common/ProcessMovies.go b/server/plugin/common/ProcessMovies.go
new file mode 100644
index 0000000..5b8f3b7
--- /dev/null
+++ b/server/plugin/common/ProcessMovies.go
@@ -0,0 +1,99 @@
+package common
+
+import (
+ "server/model"
+ "strings"
+)
+
+// ProcessMovieListInfo 处理影片列表中的信息, 后续增加片源可提通过type属性进行对应转换
+func ProcessMovieListInfo(list []model.MovieInfo) []model.Movie {
+ var movies []model.Movie
+ for _, info := range list {
+ movies = append(movies, model.Movie{
+ Id: info.Id,
+ Name: info.Name,
+ Cid: info.Cid,
+ CName: info.CName,
+ EnName: info.EnName,
+ Time: info.Time,
+ Remarks: info.Remarks,
+ PlayFrom: info.PlayFrom,
+ })
+ }
+ return movies
+}
+
+// ProcessMovieDetailList 处理影片详情列表数据
+func ProcessMovieDetailList(list []model.MovieDetailInfo) []model.MovieDetail {
+ var detailList []model.MovieDetail
+ for _, d := range list {
+ detailList = append(detailList, ProcessMovieDetail(d))
+ }
+ return detailList
+}
+
+// ProcessMovieDetail 处理单个影片详情信息
+func ProcessMovieDetail(detail model.MovieDetailInfo) model.MovieDetail {
+ md := model.MovieDetail{
+ Id: detail.Id,
+ Cid: detail.Cid,
+ Pid: detail.Pid,
+ Name: detail.Name,
+ Picture: detail.Pic,
+ DownFrom: detail.DownFrom,
+ MovieDescriptor: model.MovieDescriptor{
+ SubTitle: detail.SubTitle,
+ CName: detail.CName,
+ EnName: detail.EnName,
+ Initial: detail.Initial,
+ ClassTag: detail.ClassTag,
+ Actor: detail.Actor,
+ Director: detail.Director,
+ Writer: detail.Writer,
+ Blurb: detail.Blurb,
+ Remarks: detail.Remarks,
+ ReleaseDate: detail.PubDate,
+ Area: detail.Area,
+ Language: detail.Language,
+ Year: detail.Year,
+ State: detail.State,
+ UpdateTime: detail.UpdateTime,
+ AddTime: detail.AddTime,
+ DbId: detail.DbId,
+ DbScore: detail.DbScore,
+ Content: detail.Content,
+ },
+ }
+ // 通过分割符切分播放源信息 PlaySeparator $$$
+ md.PlayFrom = strings.Split(detail.PlayFrom, detail.PlaySeparator)
+ md.PlayList = ProcessPlayInfo(detail.PlayUrl, detail.PlaySeparator)
+ md.DownloadList = ProcessPlayInfo(detail.DownUrl, detail.PlaySeparator)
+ return md
+}
+
+// ProcessPlayInfo 处理影片播放数据信息
+func ProcessPlayInfo(info, sparator string) [][]model.MovieUrlInfo {
+ var res [][]model.MovieUrlInfo
+ // 1. 通过分隔符区分多个片源数据
+ for _, l := range strings.Split(info, sparator) {
+ // 2.对每个片源的集数和播放地址进行分割
+ var item []model.MovieUrlInfo
+ for _, p := range strings.Split(l, "#") {
+ // 3. 处理 Episode$Link 形式的播放信息
+ if strings.Contains(p, "$") {
+ item = append(item, model.MovieUrlInfo{
+ Episode: strings.Split(p, "$")[0],
+ Link: strings.Split(p, "$")[1],
+ })
+ } else {
+ item = append(item, model.MovieUrlInfo{
+ Episode: "O(∩_∩)O",
+ Link: p,
+ })
+ }
+ }
+ // 3. 将每组播放源对应的播放列表信息存储到列表中
+ res = append(res, item)
+ }
+ return res
+}
diff --git a/server/plugin/db/mysql.go b/server/plugin/db/mysql.go
new file mode 100644
index 0000000..f7e518a
--- /dev/null
+++ b/server/plugin/db/mysql.go
@@ -0,0 +1,30 @@
+package db
+
+import (
+ "gorm.io/driver/mysql"
+ "gorm.io/gorm"
+ "gorm.io/gorm/schema"
+ "server/config"
+)
+
+var Mdb *gorm.DB
+
+func InitMysql() (err error) {
+ // client 相关属性设置
+ Mdb, err = gorm.Open(mysql.New(mysql.Config{
+ DSN: config.MysqlDsn,
+ DefaultStringSize: 255, //string类型字段默认长度
+ DisableDatetimePrecision: true, // 禁用 datetime 精度
+ DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式
+ DontSupportRenameColumn: true, // 用change 重命名列
+ SkipInitializeWithVersion: false, // 根据当前Mysql版本自动配置
+ }), &gorm.Config{
+ NamingStrategy: schema.NamingStrategy{
+ //TablePrefix: "t_", //设置创建表时的前缀
+ SingularTable: true, //是否使用 结构体名称作为表名 (关闭自动变复数)
+ //NameReplacer: strings.NewReplacer("spider_", ""), // 替表名和字段中的 Me 为 空
+ },
+ //Logger: logger.Default.LogMode(logger.Info), //设置日志级别为Info
+ })
+ return
+}
diff --git a/server/plugin/db/redis.go b/server/plugin/db/redis.go
new file mode 100644
index 0000000..5a22493
--- /dev/null
+++ b/server/plugin/db/redis.go
@@ -0,0 +1,37 @@
+package db
+
+import (
+ "context"
+ "github.com/redis/go-redis/v9"
+ "server/config"
+ "time"
+)
+
+/*
+redis 工具类
+*/
+var Rdb *redis.Client
+var Cxt = context.Background()
+
+// InitRedisConn 初始化redis客户端
+func InitRedisConn() error {
+
+ Rdb = redis.NewClient(&redis.Options{
+ Addr: config.RedisAddr,
+ Password: config.RedisPassword,
+ DB: config.RedisDBNo,
+ PoolSize: 10, // 默认连接数
+ DialTimeout: time.Second * 10, // 超时时间
+ })
+ // 测试连接是否正常
+ _, err := Rdb.Ping(Cxt).Result()
+ if err != nil {
+ panic(err)
+ }
+ return nil
+}
+
+// 关闭redis连接
+func CloseRedis() error {
+ return Rdb.Close()
+}
diff --git a/server/plugin/spider/Spider.go b/server/plugin/spider/Spider.go
new file mode 100644
index 0000000..d206fdf
--- /dev/null
+++ b/server/plugin/spider/Spider.go
@@ -0,0 +1,350 @@
+package spider
+
+import (
+ "encoding/json"
+ "fmt"
+ "log"
+ "net/url"
+ "server/config"
+ "server/model"
+ "server/plugin/common"
+ "strings"
+ "sync"
+ "time"
+)
+
+/*
+ 公共资源采集站点
+ 1. 视频列表请求参数
+ ac=list 列表数据, t 影视类型ID, pg 页码, wd 关键字, h 几小时内数据
+ 2. 视频详情请求参数
+ ac=detail 详情数据, ids 影片id列表, h, pg, t 影视类型ID
+*/
+const (
+ LZ_MOVIES_URL = "https://cj.lziapi.com/api.php/provide/vod/"
+ LZ_MOVIES_Bk_URL = "https://cj.lzcaiji.com/api.php/provide/vod/"
+ TK_MOVIES_URL = "https://api.tiankongapi.com/api.php/provide/vod"
+ KC_MOVIES_URL = "https://caiji.kczyapi.com/api.php/provide/vod/"
+ FS_MOVIES_URL = "https://www.feisuzyapi.com/api.php/provide/vod/"
+
+ // FILM_COLLECT_SITE 当前使用的采集URL
+ FILM_COLLECT_SITE = "https://www.feisuzyapi.com/api.php/provide/vod/"
+)
+
+// 定义一个同步等待组
+var wg = &sync.WaitGroup{}
+
+func StartSpider() {
+ // 1. 先拉取全部分类信息
+ CategoryList()
+
+ //2. 拉取所有分类下的影片基本信息
+ tree := model.GetCategoryTree()
+ AllMovies(&tree)
+ wg.Wait()
+ log.Println("AllMovies 影片列表获取完毕")
+
+ // 3. 获取入库的所有影片详情信息
+ // 3.2 获取入库的所有影片的详情信息
+ AllMovieInfo()
+ log.Println("AllMovieInfo 所有影片详情获取完毕")
+
+ // 4. mysql批量插入与数据爬取同时进行容易出现主键冲突, 因此滞后
+ // 4.1 先一步将输入存入redis中, 待网络io结束后再进行分批扫描入库
+ // 3.1 先查找并创建search数据库
+ time.Sleep(time.Second * 10)
+ model.CreateSearchTable()
+ SearchInfoToMdb()
+ log.Println("SearchInfoToMdb 影片检索信息保存完毕")
+ time.Sleep(time.Second * 10)
+}
+
+// CategoryList 获取分类数据
+func CategoryList() {
+ // 设置请求参数信息
+ r := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`pg`, "1")
+ r.Params.Set(`t`, "1")
+ // 执行请求, 获取一次list数据
+ ApiGet(&r)
+ // 解析resp数据
+ movieListInfo := model.MovieListInfo{}
+ if len(r.Resp) <= 0 {
+ log.Println("MovieListInfo数据获取异常 : Resp Is Empty")
+ }
+ _ = json.Unmarshal(r.Resp, &movieListInfo)
+ // 获取分类列表信息
+ classList := movieListInfo.Class
+ // 组装分类数据信息树形结构
+ categoryTree := common.CategoryTree(classList)
+ // 序列化tree
+ data, _ := json.Marshal(categoryTree)
+ // 保存 tree 到redis
+ err := model.SaveCategoryTree(string(data))
+ if err != nil {
+ log.Println("SaveCategoryTree Error: ", err)
+ }
+}
+
+// AllMovies 遍历所有分类, 获取所有二级分类数据
+func AllMovies(tree *model.CategoryTree) {
+ // 遍历一级分类
+ for _, c := range tree.Children {
+ // 遍历二级分类, 屏蔽主页不需要的影片信息, 只获取 电影1 电视剧2 综艺3 动漫4等分类下的信息
+ //len(c.Children) > 0 && c.Id <= 4
+ if len(c.Children) > 0 {
+ for _, cInfo := range c.Children {
+ //go CategoryAllMovie(cInfo.Category)
+ CategoryAllMoviePlus(cInfo.Category)
+ }
+ }
+ }
+}
+
+// CategoryAllMovie 获取指定分类的所有影片基本信息
+func CategoryAllMovie(c *model.Category) {
+ // 添加一个等待任务, 执行完减去一个任务
+ wg.Add(1)
+ defer wg.Done()
+ // 设置请求参数
+ r := &RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`t`, fmt.Sprint(c.Id))
+ ApiGet(r)
+ // 解析请求数据
+ listInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &listInfo)
+ // 获取pageCount信息, 循环获取所有页数据
+ pageCount := listInfo.PageCount
+ // 开始获取所有信息, 使用协程并发获取数据
+ for i := 1; i <= int(pageCount); i++ {
+ // 使用新的 请求参数
+ r.Params.Set(`pg`, fmt.Sprint(i))
+ // 保存当前分类下的影片信息
+ info := model.MovieListInfo{}
+ ApiGet(r)
+ // 如果返回数据中的list为空,则直接结束本分类的资源获取
+ if len(r.Resp) <= 0 {
+ log.Println("SaveMoves Error Response Is Empty")
+ break
+ }
+ _ = json.Unmarshal(r.Resp, &info)
+ if info.List == nil {
+ log.Println("MovieList Is Empty")
+ break
+ }
+ // 处理影片信息
+ list := common.ProcessMovieListInfo(info.List)
+ // 保存影片信息至redis
+ _ = model.SaveMoves(list)
+ }
+}
+
+// CategoryAllMoviePlus 部分分类页数很多,因此采用单分类多协程拉取
+func CategoryAllMoviePlus(c *model.Category) {
+ // 设置请求参数
+ r := &RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set(`ac`, "list")
+ r.Params.Set(`t`, fmt.Sprint(c.Id))
+ ApiGet(r)
+ // 解析请求数据
+ listInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &listInfo)
+ // 获取pageCount信息, 循环获取所有页数据
+ pageCount := listInfo.PageCount
+ // 使用chan + goroutine 进行并发获取
+ chPg := make(chan int, int(pageCount))
+ chClose := make(chan int)
+ // 开始获取所有信息, 使用协程并发获取数据
+ for i := 1; i <= int(pageCount); i++ {
+ // 将当前分类的所有页码存入chPg
+ chPg <- i
+ }
+ close(chPg)
+ // 开启MAXGoroutine数量的协程进行请求
+ for i := 0; i < config.MAXGoroutine; i++ {
+ go func() {
+ // 当前协程结束后向 chClose中写入一次数据
+ defer func() { chClose <- 0 }()
+ for {
+ pg, ok := <-chPg
+ if !ok {
+ return
+ }
+ // 使用新的 请求参数
+ req := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ req.Params.Set(`ac`, "list")
+ req.Params.Set(`t`, fmt.Sprint(c.Id))
+ req.Params.Set(`pg`, fmt.Sprint(pg))
+ // 保存当前分类下的影片信息
+ info := model.MovieListInfo{}
+ ApiGet(&req)
+ // 如果返回数据中的list为空,则直接结束本分类的资源获取
+ if len(r.Resp) <= 0 {
+ log.Println("SaveMoves Error Response Is Empty")
+ return
+ }
+ _ = json.Unmarshal(r.Resp, &info)
+ if info.List == nil {
+ log.Println("MovieList Is Empty")
+ return
+ }
+ // 处理影片信息
+ list := common.ProcessMovieListInfo(info.List)
+ // 保存影片信息至redis
+ _ = model.SaveMoves(list)
+ }
+ }()
+ }
+ // 使用chClose等待当前分类列表数据请求完毕
+ for i := 0; i < config.MAXGoroutine; i++ {
+ <-chClose
+ }
+}
+
+// AllMovieInfo 拉取全部影片的基本信息
+func AllMovieInfo() {
+ keys := model.AllMovieInfoKey()
+ for _, key := range keys {
+ // 获取当前分类下的sort set数据集合
+ movies := model.GetMovieListByKey(key)
+ ids := ""
+ for i, m := range movies {
+ // 反序列化获取影片基本信息
+ movie := model.Movie{}
+ err := json.Unmarshal([]byte(m), &movie)
+ if err == nil && movie.Id != 0 {
+ // 拼接ids信息
+ ids = fmt.Sprintf("%s,%d", ids, movie.Id)
+ }
+ // 每20个id执行一次请求, limit 最多20
+ if (i+1)%20 == 0 {
+ // ids对应影片的详情信息
+ go MoviesDetails(strings.Trim(ids, ","))
+ ids = ""
+ }
+ }
+ // 如果ids != "" , 将剩余id执行一次请求
+ MoviesDetails(strings.Trim(ids, ","))
+ }
+}
+
+// MoviesDetails 获取影片详情信息, ids 影片id,id,....
+func MoviesDetails(ids string) {
+ // // 添加一个等待任务, 执行完减去一个任务
+ //wg.Add(1)
+ //defer wg.Done()
+ // 如果ids为空数据则直接返回
+ if len(ids) <= 0 {
+ return
+ }
+ // 设置请求参数
+ r := RequestInfo{
+ Uri: FILM_COLLECT_SITE,
+ Params: url.Values{},
+ }
+ r.Params.Set("ac", "detail")
+ r.Params.Set("ids", ids)
+ ApiGet(&r)
+ // 映射详情信息
+ details := model.DetailListInfo{}
+ // 如果返回数据为空则直接结束本次方法
+ if len(r.Resp) <= 0 {
+ return
+ }
+ // 序列化详情数据
+ err := json.Unmarshal(r.Resp, &details)
+ if err != nil {
+ log.Println("DetailListInfo Unmarshal Error: ", err)
+ return
+ }
+ // 处理details信息
+ list := common.ProcessMovieDetailList(details.List)
+ // 保存影片详情信息到redis
+ err = model.SaveDetails(list)
+ if err != nil {
+ log.Println("SaveDetails Error: ", err)
+ }
+}
+
+// SearchInfoToMdb 扫描redis中的检索信息, 并批量存入mysql
+func SearchInfoToMdb() {
+ // 1. 从redis的Zset集合中scan扫描数据, 每次100条
+ var cursor uint64 = 0
+ var count int64 = 100
+ for {
+ infoList, nextStar := model.ScanSearchInfo(cursor, count)
+ // 2. 将扫描到的数据插入mysql中
+ model.BatchSave(infoList)
+ // 3.设置下次开始的游标
+ cursor = nextStar
+ // 4. 判断迭代是否已经结束 cursor为0则表示已经迭代完毕
+ if cursor == 0 {
+ return
+ }
+ }
+
+}
+
+// GetRecentMovie 获取最近更的影片, 默认最近3小时
+func GetRecentMovie() {
+ // 请求URL URI?ac=list&h=6
+ r := RequestInfo{Uri: FILM_COLLECT_SITE, Params: url.Values{}}
+ r.Params.Set("ac", "list")
+ r.Params.Set("pg", "1")
+ r.Params.Set("h", config.UpdateInterval)
+ // 执行请求获取分页信息
+ ApiGet(&r)
+ if len(r.Resp) < 0 {
+ log.Println("更新数据获取失败")
+ return
+ }
+ pageInfo := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &pageInfo)
+ // 获取分页数据
+ ids := ""
+ // 存储检索信息
+ var tempSearchList []model.SearchInfo
+ // 获取影片详细数据,并保存到redis中
+ for i := 1; i <= int(pageInfo.PageCount); i++ {
+ // 执行获取影片基本信息
+ r.Params.Set("pg", fmt.Sprint(i))
+ ApiGet(&r)
+ // 解析请求的结果
+ if len(r.Resp) < 0 {
+ log.Println("更新数据获取失败")
+ return
+ }
+ info := model.MovieListInfo{}
+ _ = json.Unmarshal(r.Resp, &info)
+ // 将影片信息保存到 movieList
+ list := common.ProcessMovieListInfo(info.List)
+ _ = model.SaveMoves(list)
+ // 拼接ids 用于请求detail信息
+ for _, m := range list {
+ ids = fmt.Sprintf("%s,%d", ids, m.Id)
+ // 保存一份id切片用于添加mysql检索信息
+ tempSearchList = append(tempSearchList, model.SearchInfo{Mid: m.Id, Cid: m.Cid})
+ }
+ // 执行获取详情请求
+ MoviesDetails(strings.Trim(ids, ","))
+ ids = ""
+ }
+ // 根据idList 补全对应影片的searInfo信息
+ var sl []model.SearchInfo
+ for _, s := range tempSearchList {
+ // 通过id 获取对应的详情信息
+ sl = append(sl, model.ConvertSearchInfo(model.GetDetailByKey(fmt.Sprintf(config.MovieDetailKey, s.Cid, s.Mid))))
+ }
+ // 调用批量保存或更新方法, 如果对应mid数据存在则更新, 否则执行插入
+ model.BatchSaveOrUpdate(sl)
+}
+
+// StartSpiderRe 清空存储数据,从零开始获取
+func StartSpiderRe() {
+ // 删除已有的存储数据, redis 和 mysql中的存储数据全部清空
+ model.RemoveAll()
+ // 执行完整数据获取
+ StartSpider()
+}
diff --git a/server/plugin/spider/SpiderCron.go b/server/plugin/spider/SpiderCron.go
new file mode 100644
index 0000000..4e64373
--- /dev/null
+++ b/server/plugin/spider/SpiderCron.go
@@ -0,0 +1,29 @@
+package spider
+
+import (
+ "github.com/robfig/cron/v3"
+ "log"
+ "server/config"
+)
+
+// RegularUpdateMovie 定时更新, 每半小时获取一次站点的最近x小时数据
+func RegularUpdateMovie() {
+ c := cron.New(cron.WithSeconds())
+ // 开启定时任务每x 分钟更新一次最近x小时的影片数据
+ _, err := c.AddFunc(config.CornMovieUpdate, func() {
+ // 执行更新最近x小时影片的Spider
+ log.Println("执行一次影片更新任务...")
+ GetRecentMovie()
+ })
+
+ // 开启定时任务每月最后一天凌晨两点, 执行一次清库重取数据
+ _, err = c.AddFunc(config.CornUpdateAll, func() {
+ StartSpiderRe()
+ })
+
+ if err != nil {
+ log.Println("Corn Start Error: ", err)
+ }
+
+ c.Start()
+}
diff --git a/server/plugin/spider/SpiderRequest.go b/server/plugin/spider/SpiderRequest.go
new file mode 100644
index 0000000..198867f
--- /dev/null
+++ b/server/plugin/spider/SpiderRequest.go
@@ -0,0 +1,68 @@
+package spider
+
+import (
+ "fmt"
+ "github.com/gocolly/colly/v2"
+ "log"
+ "net/http"
+ "net/url"
+ "time"
+)
+
+var (
+ Client = CreateClient()
+)
+
+// RequestInfo 请求参数结构体
+type RequestInfo struct {
+ Uri string `json:"uri"` // 请求url地址
+ Params url.Values `json:"params"` // 请求参数
+ Header http.Header `json:"header"` // 请求头数据
+ Resp []byte `json:"resp"` // 响应结果数据
+}
+
+// CreateClient 初始化请求客户端
+func CreateClient() *colly.Collector {
+ c := colly.NewCollector()
+ // 设置代理信息
+ //if proxy, err := proxy.RoundRobinProxySwitcher("127.0.0.1:7890"); err != nil {
+ // c.SetProxyFunc(proxy)
+ //}
+ // 设置并发数量控制
+ //c.Async = true
+ // 访问深度
+ c.MaxDepth = 1
+ //可重复访问
+ c.AllowURLRevisit = true
+ // 设置超时时间 默认10s
+ c.SetRequestTimeout(20 * time.Second)
+ // 发起请求之前会调用的方法
+ c.OnRequest(func(request *colly.Request) {
+ // 设置一些请求头信息
+ request.Headers.Set("Content-Type", "application/json;charset=UTF-8")
+ request.Headers.Set("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36")
+ //request.Headers.Set("cookie", "ge_ua_key=sxo%2Bz4kkS7clWpEtg2m7HioRfIo%3D")
+ request.Headers.Set("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
+ })
+ // 请求期间报错的回调
+ c.OnError(func(response *colly.Response, err error) {
+ log.Printf("请求异常: URL: %s Error: %s\n", response.Request.URL, err)
+ })
+ return c
+}
+
+// ApiGet 请求数据的方法
+func ApiGet(r *RequestInfo) {
+ // 请求成功后的响应
+ Client.OnResponse(func(response *colly.Response) {
+ // 将响应结构封装到 RequestInfo.Resp中
+ r.Resp = response.Body
+ // 拿到response后输出请求url
+ //log.Println("\n请求成功: ", response.Request.URL)
+ })
+ // 处理请求参数
+ err := Client.Visit(fmt.Sprintf("%s?%s", r.Uri, r.Params.Encode()))
+ if err != nil {
+ log.Println("获取数据失败: ", err)
+ }
+}
diff --git a/server/router/router.go b/server/router/router.go
new file mode 100644
index 0000000..534e2ff
--- /dev/null
+++ b/server/router/router.go
@@ -0,0 +1,68 @@
+package router
+
+import (
+ "github.com/gin-gonic/gin"
+ "log"
+ "net/http"
+ "server/controller"
+)
+
+func SetupRouter() *gin.Engine {
+
+ r := gin.Default()
+ // 开启跨域
+ r.Use(Cors())
+
+ r.GET(`/index`, controller.Index)
+ r.GET(`/navCategory`, controller.CategoriesInfo)
+ r.GET(`/filmDetail`, controller.FilmDetail)
+ r.GET(`/filmPlayInfo`, controller.FilmPlayInfo)
+ r.GET(`/searchFilm`, controller.SearchFilm)
+ r.GET(`/filmCategory`, controller.FilmCategory)
+
+ // 触发spider
+ spiderRoute := r.Group(`/spider`)
+ {
+ // 清空全部数据并从零开始获取数据
+ spiderRoute.GET("/SpiderRe", controller.SpiderRe)
+ // 获取影片详情, 用于网路不稳定导致的影片数据缺失
+ spiderRoute.GET(`/FixFilmDetail`, controller.FixFilmDetail)
+ }
+
+ return r
+}
+
+// Cors 开启跨域请求
+func Cors() gin.HandlerFunc {
+ return func(c *gin.Context) {
+ method := c.Request.Method
+ origin := c.Request.Header.Get("Origin") //请求头部
+ if origin != "" {
+ //接收客户端发送的origin (重要!)
+ c.Writer.Header().Set("Access-Control-Allow-Origin", origin)
+ //服务器支持的所有跨域请求的方法
+ c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE,UPDATE")
+ //允许跨域设置可以返回其他子段,可以自定义字段
+ c.Header("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token,session, Content-Type")
+ // 允许浏览器(客户端)可以解析的头部 (重要)
+ c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type")
+ //设置缓存时间
+ c.Header("Access-Control-Max-Age", "172800")
+ //允许客户端传递校验信息比如 cookie (重要)
+ c.Header("Access-Control-Allow-Credentials", "true")
+ }
+
+ //允许类型校验
+ if method == "OPTIONS" {
+ c.JSON(http.StatusOK, "ok!")
+ }
+
+ defer func() {
+ if err := recover(); err != nil {
+ log.Printf("Panic info is: %v", err)
+ }
+ }()
+
+ c.Next()
+ }
+}