import{bD as M,b_ as oe,cv as re,cw as te,bJ as ne,d as _,r as a,a9 as le,cx as se,cy as R,cz as S,n as x,D as d,p as w,a_ as V,q as H,a7 as ae,cA as ie,aa as ce,G as de,b0 as K,s as O,v as W,b8 as k,a as E,cB as pe,L as P,M as q,y as G,aK as J,aW as fe,aV as ue,aU as he,aX as ge,aJ as ve,ac as me,cC as Ce,m as xe,A as be,af as T,av as we,cD as Ie,H as X,az as ye,cE as j,cF as ze,I as Pe,b4 as Re,i as Se,aS as Ee,cG as U,cH as $e}from"./index-U-PhABqT.js";function Ne(e,o,n,i){if(!M(e))return e;o=oe(o,e);for(var t=-1,r=o.length,b=r-1,u=e;u!=null&&++t<r;){var l=re(o[t]),p=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(t!=b){var h=u[l];p=void 0,p===void 0&&(p=M(h)?h:te(o[t+1])?[]:{})}ne(u,l,p),u=u[l]}return e}function ke(e,o,n){return e==null?e:Ne(e,o,n)}const Ae=_({name:"ChevronLeft",render(){return a("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z",fill:"currentColor"}))}});function _e(e){const{lineHeight:o,borderRadius:n,fontWeightStrong:i,baseColor:t,dividerColor:r,actionColor:b,textColor1:u,textColor2:l,closeColorHover:p,closeColorPressed:h,closeIconColor:s,closeIconColorHover:v,closeIconColorPressed:g,infoColor:c,successColor:m,warningColor:f,errorColor:C,fontSize:I}=e;return Object.assign(Object.assign({},se),{fontSize:I,lineHeight:o,titleFontWeight:i,borderRadius:n,border:`1px solid ${r}`,color:b,titleTextColor:u,iconColor:l,contentTextColor:l,closeBorderRadius:n,closeColorHover:p,closeColorPressed:h,closeIconColor:s,closeIconColorHover:v,closeIconColorPressed:g,borderInfo:`1px solid ${R(t,S(c,{alpha:.25}))}`,colorInfo:R(t,S(c,{alpha:.08})),titleTextColorInfo:u,iconColorInfo:c,contentTextColorInfo:l,closeColorHoverInfo:p,closeColorPressedInfo:h,closeIconColorInfo:s,closeIconColorHoverInfo:v,closeIconColorPressedInfo:g,borderSuccess:`1px solid ${R(t,S(m,{alpha:.25}))}`,colorSuccess:R(t,S(m,{alpha:.08})),titleTextColorSuccess:u,iconColorSuccess:m,contentTextColorSuccess:l,closeColorHoverSuccess:p,closeColorPressedSuccess:h,closeIconColorSuccess:s,closeIconColorHoverSuccess:v,closeIconColorPressedSuccess:g,borderWarning:`1px solid ${R(t,S(f,{alpha:.33}))}`,colorWarning:R(t,S(f,{alpha:.08})),titleTextColorWarning:u,iconColorWarning:f,contentTextColorWarning:l,closeColorHoverWarning:p,closeColorPressedWarning:h,closeIconColorWarning:s,closeIconColorHoverWarning:v,closeIconColorPressedWarning:g,borderError:`1px solid ${R(t,S(C,{alpha:.25}))}`,colorError:R(t,S(C,{alpha:.08})),titleTextColorError:u,iconColorError:C,contentTextColorError:l,closeColorHoverError:p,closeColorPressedError:h,closeIconColorError:s,closeIconColorHoverError:v,closeIconColorPressedError:g})}const Te={common:le,self:_e},He=x("alert",`
 line-height: var(--n-line-height);
 border-radius: var(--n-border-radius);
 position: relative;
 transition: background-color .3s var(--n-bezier);
 background-color: var(--n-color);
 text-align: start;
 word-break: break-word;
`,[d("border",`
 border-radius: inherit;
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 transition: border-color .3s var(--n-bezier);
 border: var(--n-border);
 pointer-events: none;
 `),w("closable",[x("alert-body",[d("title",`
 padding-right: 24px;
 `)])]),d("icon",{color:"var(--n-icon-color)"}),x("alert-body",{padding:"var(--n-padding)"},[d("title",{color:"var(--n-title-text-color)"}),d("content",{color:"var(--n-content-text-color)"})]),V({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),d("icon",`
 position: absolute;
 left: 0;
 top: 0;
 align-items: center;
 justify-content: center;
 display: flex;
 width: var(--n-icon-size);
 height: var(--n-icon-size);
 font-size: var(--n-icon-size);
 margin: var(--n-icon-margin);
 `),d("close",`
 transition:
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 position: absolute;
 right: 0;
 top: 0;
 margin: var(--n-close-margin);
 `),w("show-icon",[x("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),w("right-adjust",[x("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),x("alert-body",`
 border-radius: var(--n-border-radius);
 transition: border-color .3s var(--n-bezier);
 `,[d("title",`
 transition: color .3s var(--n-bezier);
 font-size: 16px;
 line-height: 19px;
 font-weight: var(--n-title-font-weight);
 `,[H("& +",[d("content",{marginTop:"9px"})])]),d("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),d("icon",{transition:"color .3s var(--n-bezier)"})]),We=Object.assign(Object.assign({},W.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),Me=_({name:"Alert",inheritAttrs:!1,props:We,slots:Object,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:n,inlineThemeDisabled:i,mergedRtlRef:t}=O(e),r=W("Alert","-alert",He,Te,e,o),b=k("Alert",t,o),u=E(()=>{const{common:{cubicBezierEaseInOut:g},self:c}=r.value,{fontSize:m,borderRadius:f,titleFontWeight:C,lineHeight:I,iconSize:$,iconMargin:y,iconMarginRtl:N,closeIconSize:A,closeBorderRadius:D,closeSize:B,closeMargin:L,closeMarginRtl:F,padding:Q}=c,{type:z}=e,{left:Y,right:ee}=pe(y);return{"--n-bezier":g,"--n-color":c[P("color",z)],"--n-close-icon-size":A,"--n-close-border-radius":D,"--n-close-color-hover":c[P("closeColorHover",z)],"--n-close-color-pressed":c[P("closeColorPressed",z)],"--n-close-icon-color":c[P("closeIconColor",z)],"--n-close-icon-color-hover":c[P("closeIconColorHover",z)],"--n-close-icon-color-pressed":c[P("closeIconColorPressed",z)],"--n-icon-color":c[P("iconColor",z)],"--n-border":c[P("border",z)],"--n-title-text-color":c[P("titleTextColor",z)],"--n-content-text-color":c[P("contentTextColor",z)],"--n-line-height":I,"--n-border-radius":f,"--n-font-size":m,"--n-title-font-weight":C,"--n-icon-size":$,"--n-icon-margin":y,"--n-icon-margin-rtl":N,"--n-close-size":B,"--n-close-margin":L,"--n-close-margin-rtl":F,"--n-padding":Q,"--n-icon-margin-left":Y,"--n-icon-margin-right":ee}}),l=i?q("alert",E(()=>e.type[0]),u,e):void 0,p=G(!0),h=()=>{const{onAfterLeave:g,onAfterHide:c}=e;g&&g(),c&&c()};return{rtlEnabled:b,mergedClsPrefix:o,mergedBordered:n,visible:p,handleCloseClick:()=>{var g;Promise.resolve((g=e.onClose)===null||g===void 0?void 0:g.call(e)).then(c=>{c!==!1&&(p.value=!1)})},handleAfterLeave:()=>{h()},mergedTheme:r,cssVars:i?void 0:u,themeClass:l?.themeClass,onRender:l?.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),a(K,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:n}=this,i={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,!this.title&&this.closable&&`${o}-alert--right-adjust`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?a("div",Object.assign({},ae(this.$attrs,i)),this.closable&&a(ie,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&a("div",{class:`${o}-alert__border`}),this.showIcon&&a("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},ce(n.icon,()=>[a(J,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return a(ge,null);case"info":return a(he,null);case"warning":return a(ue,null);case"error":return a(fe,null);default:return null}}})])),a("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},de(n.header,t=>{const r=t||this.title;return r?a("div",{class:`${o}-alert-body__title`},r):null}),n.default&&a("div",{class:`${o}-alert-body__content`},n))):null}})}}),De=x("collapse","width: 100%;",[x("collapse-item",`
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 transition:
 color .3s var(--n-bezier),
 border-color .3s var(--n-bezier);
 margin: var(--n-item-margin);
 `,[w("disabled",[d("header","cursor: not-allowed;",[d("header-main",`
 color: var(--n-title-text-color-disabled);
 `),x("collapse-item-arrow",`
 color: var(--n-arrow-color-disabled);
 `)])]),x("collapse-item","margin-left: 32px;"),H("&:first-child","margin-top: 0;"),H("&:first-child >",[d("header","padding-top: 0;")]),w("left-arrow-placement",[d("header",[x("collapse-item-arrow","margin-right: 4px;")])]),w("right-arrow-placement",[d("header",[x("collapse-item-arrow","margin-left: 4px;")])]),d("content-wrapper",[d("content-inner","padding-top: 16px;"),V({duration:"0.15s"})]),w("active",[d("header",[w("active",[x("collapse-item-arrow","transform: rotate(90deg);")])])]),H("&:not(:first-child)","border-top: 1px solid var(--n-divider-color);"),ve("disabled",[w("trigger-area-main",[d("header",[d("header-main","cursor: pointer;"),x("collapse-item-arrow","cursor: default;")])]),w("trigger-area-arrow",[d("header",[x("collapse-item-arrow","cursor: pointer;")])]),w("trigger-area-extra",[d("header",[d("header-extra","cursor: pointer;")])])]),d("header",`
 font-size: var(--n-title-font-size);
 display: flex;
 flex-wrap: nowrap;
 align-items: center;
 transition: color .3s var(--n-bezier);
 position: relative;
 padding: var(--n-title-padding);
 color: var(--n-title-text-color);
 `,[d("header-main",`
 display: flex;
 flex-wrap: nowrap;
 align-items: center;
 font-weight: var(--n-title-font-weight);
 transition: color .3s var(--n-bezier);
 flex: 1;
 color: var(--n-title-text-color);
 `),d("header-extra",`
 display: flex;
 align-items: center;
 transition: color .3s var(--n-bezier);
 color: var(--n-text-color);
 `),x("collapse-item-arrow",`
 display: flex;
 transition:
 transform .15s var(--n-bezier),
 color .3s var(--n-bezier);
 font-size: 18px;
 color: var(--n-arrow-color);
 `)])])]),Be=Object.assign(Object.assign({},W.props),{defaultExpandedNames:{type:[Array,String],default:null},expandedNames:[Array,String],arrowPlacement:{type:String,default:"left"},accordion:{type:Boolean,default:!1},displayDirective:{type:String,default:"if"},triggerAreas:{type:Array,default:()=>["main","extra","arrow"]},onItemHeaderClick:[Function,Array],"onUpdate:expandedNames":[Function,Array],onUpdateExpandedNames:[Function,Array],onExpandedNamesChange:{type:[Function,Array],validator:()=>!0,default:void 0}}),Z=xe("n-collapse"),je=_({name:"Collapse",props:Be,slots:Object,setup(e,{slots:o}){const{mergedClsPrefixRef:n,inlineThemeDisabled:i,mergedRtlRef:t}=O(e),r=G(e.defaultExpandedNames),b=E(()=>e.expandedNames),u=me(b,r),l=W("Collapse","-collapse",De,Ce,e,n);function p(m){const{"onUpdate:expandedNames":f,onUpdateExpandedNames:C,onExpandedNamesChange:I}=e;C&&T(C,m),f&&T(f,m),I&&T(I,m),r.value=m}function h(m){const{onItemHeaderClick:f}=e;f&&T(f,m)}function s(m,f,C){const{accordion:I}=e,{value:$}=u;if(I)m?(p([f]),h({name:f,expanded:!0,event:C})):(p([]),h({name:f,expanded:!1,event:C}));else if(!Array.isArray($))p([f]),h({name:f,expanded:!0,event:C});else{const y=$.slice(),N=y.findIndex(A=>f===A);~N?(y.splice(N,1),p(y),h({name:f,expanded:!1,event:C})):(y.push(f),p(y),h({name:f,expanded:!0,event:C}))}}be(Z,{props:e,mergedClsPrefixRef:n,expandedNamesRef:u,slots:o,toggleItem:s});const v=k("Collapse",t,n),g=E(()=>{const{common:{cubicBezierEaseInOut:m},self:{titleFontWeight:f,dividerColor:C,titlePadding:I,titleTextColor:$,titleTextColorDisabled:y,textColor:N,arrowColor:A,fontSize:D,titleFontSize:B,arrowColorDisabled:L,itemMargin:F}}=l.value;return{"--n-font-size":D,"--n-bezier":m,"--n-text-color":N,"--n-divider-color":C,"--n-title-padding":I,"--n-title-font-size":B,"--n-title-text-color":$,"--n-title-text-color-disabled":y,"--n-title-font-weight":f,"--n-arrow-color":A,"--n-arrow-color-disabled":L,"--n-item-margin":F}}),c=i?q("collapse",void 0,g,e):void 0;return{rtlEnabled:v,mergedTheme:l,mergedClsPrefix:n,cssVars:i?void 0:g,themeClass:c?.themeClass,onRender:c?.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),a("div",{class:[`${this.mergedClsPrefix}-collapse`,this.rtlEnabled&&`${this.mergedClsPrefix}-collapse--rtl`,this.themeClass],style:this.cssVars},this.$slots)}}),Le=_({name:"CollapseItemContent",props:{displayDirective:{type:String,required:!0},show:Boolean,clsPrefix:{type:String,required:!0}},setup(e){return{onceTrue:Ie(X(e,"show"))}},render(){return a(K,null,{default:()=>{const{show:e,displayDirective:o,onceTrue:n,clsPrefix:i}=this,t=o==="show"&&n,r=a("div",{class:`${i}-collapse-item__content-wrapper`},a("div",{class:`${i}-collapse-item__content-inner`},this.$slots));return t?we(r,[[ye,e]]):e?r:null}})}}),Fe={title:String,name:[String,Number],disabled:Boolean,displayDirective:String},Ue=_({name:"CollapseItem",props:Fe,setup(e){const{mergedRtlRef:o}=O(e),n=Pe(),i=Re(()=>{var s;return(s=e.name)!==null&&s!==void 0?s:n}),t=Se(Z);t||Ee("collapse-item","`n-collapse-item` must be placed inside `n-collapse`.");const{expandedNamesRef:r,props:b,mergedClsPrefixRef:u,slots:l}=t,p=E(()=>{const{value:s}=r;if(Array.isArray(s)){const{value:v}=i;return!~s.findIndex(g=>g===v)}else if(s){const{value:v}=i;return v!==s}return!0});return{rtlEnabled:k("Collapse",o,u),collapseSlots:l,randomName:n,mergedClsPrefix:u,collapsed:p,triggerAreas:X(b,"triggerAreas"),mergedDisplayDirective:E(()=>{const{displayDirective:s}=e;return s||b.displayDirective}),arrowPlacement:E(()=>b.arrowPlacement),handleClick(s){let v="main";U(s,"arrow")&&(v="arrow"),U(s,"extra")&&(v="extra"),b.triggerAreas.includes(v)&&t&&!e.disabled&&t.toggleItem(p.value,i.value,s)}}},render(){const{collapseSlots:e,$slots:o,arrowPlacement:n,collapsed:i,mergedDisplayDirective:t,mergedClsPrefix:r,disabled:b,triggerAreas:u}=this,l=j(o.header,{collapsed:i},()=>[this.title]),p=o["header-extra"]||e["header-extra"],h=o.arrow||e.arrow;return a("div",{class:[`${r}-collapse-item`,`${r}-collapse-item--${n}-arrow-placement`,b&&`${r}-collapse-item--disabled`,!i&&`${r}-collapse-item--active`,u.map(s=>`${r}-collapse-item--trigger-area-${s}`)]},a("div",{class:[`${r}-collapse-item__header`,!i&&`${r}-collapse-item__header--active`]},a("div",{class:`${r}-collapse-item__header-main`,onClick:this.handleClick},n==="right"&&l,a("div",{class:`${r}-collapse-item-arrow`,key:this.rtlEnabled?0:1,"data-arrow":!0},j(h,{collapsed:i},()=>[a(J,{clsPrefix:r},{default:()=>this.rtlEnabled?a(Ae,null):a($e,null)})])),n==="left"&&l),ze(p,{collapsed:i},s=>a("div",{class:`${r}-collapse-item__header-extra`,onClick:this.handleClick,"data-extra":!0},s))),a(Le,{clsPrefix:r,displayDirective:t,show:!i},o))}});function Ve(e,o){const n=e.slice(),i=[];let t=0;for(let r=0;r<e.length;r++){if(o(e[r],r,n)){i.push(e[r]);continue}if(!Object.hasOwn(e,r)){delete e[t++];continue}e[t++]=e[r]}return e.length=t,i}export{je as N,Ue as a,Me as b,Ne as c,Ve as r,ke as s};
