import{D as Ne,aV as Gt,z as P,b as A,e as Ue,aW as lt,aX as ee,h as n,d as V,Q as Ae,aY as ye,aZ as re,a_ as ie,a$ as Xt,b0 as dt,b1 as Xe,b2 as qt,v as Zt,b3 as Yt,U as oe,ab as he,au as Be,b4 as Ce,a9 as U,aH as qe,b5 as Kt,b6 as ut,b7 as Qt,b8 as Ze,Y as ne,a4 as Jt,a0 as er,b9 as tr,S as B,R as p,ba as _e,aN as rr,W as nr,a7 as ir,I as or,af as Le,bb as ve,$ as Re,bc as ar,bd as sr,C as Ye,be as lr,aQ as xe,F as De,ah as W,s as dr,bf as Me,bg as Ee,X as z,a2 as le,aM as ct,aJ as ft,aK as ht,aL as pt,bh as ur,a3 as je,bi as cr,bj as fr,bk as hr,bl as Se,ag as pr,aB as gt,j as me,bm as gr,bn as vr,bo as mr,aF as Ke,T as J,bp as br,bq as wr,a8 as xr,aa as yr,br as Cr,A as Rr,aj as Qe,al as vt,ay as mt}from"./index-aa2e1a24.js";import{g as Sr}from"./get-slot-1efb97e5.js";import{A as kr}from"./Add-4bb9ce12.js";import{N as Pr}from"./Tooltip-8a98fe40.js";function $r(e){if(typeof e=="number")return{"":e.toString()};const i={};return e.split(/ +/).forEach(t=>{if(t==="")return;const[r,o]=t.split(":");o===void 0?i[""]=r:i[r]=o}),i}function ce(e,i){var t;if(e==null)return;const r=$r(e);if(i===void 0)return r[""];if(typeof i=="string")return(t=r[i])!==null&&t!==void 0?t:r[""];if(Array.isArray(i)){for(let o=i.length-1;o>=0;--o){const s=i[o];if(s in r)return r[s]}return r[""]}else{let o,s=-1;return Object.keys(r).forEach(l=>{const c=Number(l);!Number.isNaN(c)&&i>=c&&c>=s&&(s=c,o=r[l])}),o}}function Lr(e){var i;const t=(i=e.dirs)===null||i===void 0?void 0:i.find(({dir:r})=>r===Ne);return!!(t&&t.value===!1)}const Tr={xs:0,s:640,m:1024,l:1280,xl:1536,"2xl":1920};function Or(e){return`(min-width: ${e}px)`}const fe={};function Ir(e=Tr){if(!Gt)return P(()=>[]);if(typeof window.matchMedia!="function")return P(()=>[]);const i=A({}),t=Object.keys(e),r=(o,s)=>{o.matches?i.value[s]=!0:i.value[s]=!1};return t.forEach(o=>{const s=e[o];let l,c;fe[s]===void 0?(l=window.matchMedia(Or(s)),l.addEventListener?l.addEventListener("change",u=>{c.forEach(a=>{a(u,o)})}):l.addListener&&l.addListener(u=>{c.forEach(a=>{a(u,o)})}),c=new Set,fe[s]={mql:l,cbs:c}):(l=fe[s].mql,c=fe[s].cbs),c.add(r),l.matches&&c.forEach(u=>{u(l,o)})}),Ue(()=>{t.forEach(o=>{const{cbs:s}=fe[e[o]];s.has(r)&&s.delete(r)})}),P(()=>{const{value:o}=i;return t.filter(s=>o[s])})}function zr(e,i,t,r){var o=-1,s=e==null?0:e.length;for(r&&s&&(t=e[++o]);++o{var i;const{root:t=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(i=e.threshold)!==null&&i!==void 0?i:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof t=="string"?document.querySelector(t):t)||document.documentElement})}},Te=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,En=(e,i,t)=>{if(!e)return()=>{};const r=Mn(i),{root:o}=r.options;let s;const l=Te.get(o);l?s=l:(s=new Map,Te.set(o,s));let c,u;s.has(r.hash)?(u=s.get(r.hash),u[1].has(e)||(c=u[0],u[1].add(e),c.observe(e))):(c=new IntersectionObserver(f=>{f.forEach(y=>{if(y.isIntersecting){const h=Oe.get(y.target),S=Ie.get(y.target);h&&h(),S&&(S.value=!0)}})},r.options),c.observe(e),u=[c,new Set([e])],s.set(r.hash,u));let a=!1;const d=()=>{a||(Oe.delete(e),Ie.delete(e),a=!0,u[1].has(e)&&(u[0].unobserve(e),u[1].delete(e)),u[1].size<=0&&s.delete(r.hash),s.size||Te.delete(o))};return Oe.set(e,d),Ie.set(e,t),d},nt=1,It=ye("n-grid"),zt=1,Fe={span:{type:[Number,String],default:zt},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}},jn=Xt(Fe),Nn=V({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:Fe,setup(){const{isSsrRef:e,xGapRef:i,itemStyleRef:t,overflowRef:r,layoutShiftDisabledRef:o}=re(It),s=dt();return{overflow:r,itemStyle:t,layoutShiftDisabled:o,mergedXGap:P(()=>ie(i.value||0)),deriveStyle:()=>{e.value;const{privateSpan:l=zt,privateShow:c=!0,privateColStart:u=void 0,privateOffset:a=0}=s.vnode.props,{value:d}=i,f=ie(d||0);return{display:c?"":"none",gridColumn:`${u??`span ${l}`} / span ${l}`,marginLeft:a?`calc((100% - (${l} - 1) * ${f}) / ${l} * ${a} + ${f} * ${a})`:""}}}},render(){var e,i;if(this.layoutShiftDisabled){const{span:t,offset:r,mergedXGap:o}=this;return n("div",{style:{gridColumn:`span ${t} / span ${t}`,marginLeft:r?`calc((100% - (${t} - 1) * ${o}) / ${t} * ${r} + ${o} * ${r})`:""}},this.$slots)}return n("div",{style:[this.itemStyle,this.deriveStyle()]},(i=(e=this.$slots).default)===null||i===void 0?void 0:i.call(e,{overflow:this.overflow}))}}),Un=Object.assign(Object.assign({},Fe),Yt),Mi=V({__GRID_ITEM__:!0,name:"FormItemGridItem",alias:["FormItemGi"],props:Un,setup(){const e=A(null);return{formItemInstRef:e,validate:(...r)=>{const{value:o}=e;if(o)return o.validate(...r)},restoreValidation:()=>{const{value:r}=e;r&&r.restoreValidation()}}},render(){return n(Nn,Xe(this.$.vnode.props||{},jn),{default:()=>{const e=Xe(this.$props,qt);return n(Zt,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}}),An={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},Bt=24,ze="__ssr__",Fn={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:Bt},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},Ei=V({name:"Grid",inheritAttrs:!1,props:Fn,setup(e){const{mergedClsPrefixRef:i,mergedBreakpointsRef:t}=oe(e),r=/^\d+$/,o=A(void 0),s=Ir((t==null?void 0:t.value)||An),l=he(()=>!!(e.itemResponsive||!r.test(e.cols.toString())||!r.test(e.xGap.toString())||!r.test(e.yGap.toString()))),c=P(()=>{if(l.value)return e.responsive==="self"?o.value:s.value}),u=he(()=>{var k;return(k=Number(ce(e.cols.toString(),c.value)))!==null&&k!==void 0?k:Bt}),a=he(()=>ce(e.xGap.toString(),c.value)),d=he(()=>ce(e.yGap.toString(),c.value)),f=k=>{o.value=k.contentRect.width},y=k=>{ut(f,k)},h=A(!1),S=P(()=>{if(e.responsive==="self")return y}),w=A(!1),$=A();return Be(()=>{const{value:k}=$;k&&k.hasAttribute(ze)&&(k.removeAttribute(ze),w.value=!0)}),Ce(It,{layoutShiftDisabledRef:U(e,"layoutShiftDisabled"),isSsrRef:w,itemStyleRef:U(e,"itemStyle"),xGapRef:a,overflowRef:h}),{isSsr:!Ae,contentEl:$,mergedClsPrefix:i,style:P(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:ie(e.xGap),rowGap:ie(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${u.value}, minmax(0, 1fr))`,columnGap:ie(a.value),rowGap:ie(d.value)}),isResponsive:l,responsiveQuery:c,responsiveCols:u,handleResize:S,overflow:h}},render(){if(this.layoutShiftDisabled)return n("div",qe({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var i,t,r,o,s,l,c;this.overflow=!1;const u=Qt(Sr(this)),a=[],{collapsed:d,collapsedRows:f,responsiveCols:y,responsiveQuery:h}=this;u.forEach(x=>{var L,T,g,R;if(((L=x==null?void 0:x.type)===null||L===void 0?void 0:L.__GRID_ITEM__)!==!0)return;if(Lr(x)){const v=Ze(x);v.props?v.props.privateShow=!1:v.props={privateShow:!1},a.push({child:v,rawChildSpan:0});return}x.dirs=((T=x.dirs)===null||T===void 0?void 0:T.filter(({dir:v})=>v!==Ne))||null;const O=Ze(x),_=Number((R=ce((g=O.props)===null||g===void 0?void 0:g.span,h))!==null&&R!==void 0?R:nt);_!==0&&a.push({child:O,rawChildSpan:_})});let S=0;const w=(i=a[a.length-1])===null||i===void 0?void 0:i.child;if(w!=null&&w.props){const x=(t=w.props)===null||t===void 0?void 0:t.suffix;x!==void 0&&x!==!1&&(S=(o=(r=w.props)===null||r===void 0?void 0:r.span)!==null&&o!==void 0?o:nt,w.props.privateSpan=S,w.props.privateColStart=y+1-S,w.props.privateShow=(s=w.props.privateShow)!==null&&s!==void 0?s:!0)}let $=0,k=!1;for(const{child:x,rawChildSpan:L}of a){if(k&&(this.overflow=!0),!k){const T=Number((c=ce((l=x.props)===null||l===void 0?void 0:l.offset,h))!==null&&c!==void 0?c:0),g=Math.min(L+T,y);if(x.props?(x.props.privateSpan=g,x.props.privateOffset=T):x.props={privateSpan:g,privateOffset:T},d){const R=$%y;g+R>y&&($+=y-R),g+$+S>f*y?k=!0:$+=g}}k&&(x.props?x.props.privateShow!==!0&&(x.props.privateShow=!1):x.props={privateShow:!1})}return n("div",qe({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[ze]:this.isSsr||void 0},this.$attrs),a.map(({child:x})=>x))};return this.isResponsive&&this.responsive==="self"?n(Kt,{onResize:this.handleResize},{default:e}):e()}}),He=Object.assign(Object.assign({},ne.props),{showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),_t=ye("n-image");function Hn(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const Wn=Jt({name:"Image",common:er,peers:{Tooltip:tr},self:Hn}),Vn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),Gn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),Xn=n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),qn=B([B("body >",[p("image-container","position: fixed;")]),p("image-preview-container",` position: fixed; left: 0; right: 0; top: 0; bottom: 0; display: flex; `),p("image-preview-overlay",` z-index: -1; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .3); `,[_e()]),p("image-preview-toolbar",` z-index: 1; position: absolute; left: 50%; transform: translateX(-50%); border-radius: var(--n-toolbar-border-radius); height: 48px; bottom: 40px; padding: 0 12px; background: var(--n-toolbar-color); box-shadow: var(--n-toolbar-box-shadow); color: var(--n-toolbar-icon-color); transition: color .3s var(--n-bezier); display: flex; align-items: center; `,[p("base-icon",` padding: 0 8px; font-size: 28px; cursor: pointer; `),_e()]),p("image-preview-wrapper",` position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; pointer-events: none; `,[rr()]),p("image-preview",` user-select: none; -webkit-user-select: none; pointer-events: all; margin: auto; max-height: calc(100vh - 32px); max-width: calc(100vw - 32px); transition: transform .3s var(--n-bezier); `),p("image",` display: inline-flex; max-height: 100%; max-width: 100%; `,[nr("preview-disabled",` cursor: pointer; `),B("img",` border-radius: inherit; `)])]),be=32,Dt=V({name:"ImagePreview",props:Object.assign(Object.assign({},He),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const i=ne("Image","-image",qn,Wn,e,U(e,"clsPrefix"));let t=null;const r=A(null),o=A(null),s=A(void 0),l=A(!1),c=A(!1),{localeRef:u}=ir("Image");function a(){const{value:m}=o;if(!t||!m)return;const{style:C}=m,b=t.getBoundingClientRect(),M=b.left+b.width/2,E=b.top+b.height/2;C.transformOrigin=`${M}px ${E}px`}function d(m){var C,b;switch(m.key){case" ":m.preventDefault();break;case"ArrowLeft":(C=e.onPrev)===null||C===void 0||C.call(e);break;case"ArrowRight":(b=e.onNext)===null||b===void 0||b.call(e);break;case"Escape":We();break}}or(l,m=>{m?Le("keydown",document,d):ve("keydown",document,d)}),Ue(()=>{ve("keydown",document,d)});let f=0,y=0,h=0,S=0,w=0,$=0,k=0,x=0,L=!1;function T(m){const{clientX:C,clientY:b}=m;h=C-f,S=b-y,ut(q)}function g(m){const{mouseUpClientX:C,mouseUpClientY:b,mouseDownClientX:M,mouseDownClientY:E}=m,X=M-C,K=E-b,Q=`vertical${K>0?"Top":"Bottom"}`,te=`horizontal${X>0?"Left":"Right"}`;return{moveVerticalDirection:Q,moveHorizontalDirection:te,deltaHorizontal:X,deltaVertical:K}}function R(m){const{value:C}=r;if(!C)return{offsetX:0,offsetY:0};const b=C.getBoundingClientRect(),{moveVerticalDirection:M,moveHorizontalDirection:E,deltaHorizontal:X,deltaVertical:K}=m||{};let Q=0,te=0;return b.width<=window.innerWidth?Q=0:b.left>0?Q=(b.width-window.innerWidth)/2:b.right0?te=(b.height-window.innerHeight)/2:b.bottom.5){const m=I;G-=1,I=Math.max(.5,Math.pow(D,G));const C=m-I;q(!1);const b=R();I+=C,q(!1),I-=C,h=b.offsetX,S=b.offsetY,q()}}function q(m=!0){var C;const{value:b}=r;if(!b)return;const{style:M}=b,E=dr((C=_==null?void 0:_.previewedImgPropsRef.value)===null||C===void 0?void 0:C.style);let X="";if(typeof E=="string")X=E+";";else for(const Q in E)X+=`${Sn(Q)}: ${E[Q]};`;const K=`transform-origin: center; transform: translateX(${h}px) translateY(${S}px) rotate(${F}deg) scale(${I});`;L?M.cssText=X+"cursor: grabbing; transition: none;"+K:M.cssText=X+"cursor: grab;"+K+(m?"":"transition: none;"),m||b.offsetHeight}function We(){l.value=!l.value,c.value=!0}function Ht(){I=ge(),G=Math.ceil(Math.log(I)/Math.log(D)),h=0,S=0,q()}const Wt={setPreviewSrc:m=>{s.value=m},setThumbnailEl:m=>{t=m},toggleShow:We};function Vt(m,C){if(e.showToolbarTooltip){const{value:b}=i;return n(Pr,{to:!1,theme:b.peers.Tooltip,themeOverrides:b.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>u.value[C],trigger:()=>m})}else return m}const Ve=P(()=>{const{common:{cubicBezierEaseInOut:m},self:{toolbarIconColor:C,toolbarBorderRadius:b,toolbarBoxShadow:M,toolbarColor:E}}=i.value;return{"--n-bezier":m,"--n-toolbar-icon-color":C,"--n-toolbar-color":E,"--n-toolbar-border-radius":b,"--n-toolbar-box-shadow":M}}),{inlineThemeDisabled:Ge}=oe(),se=Ge?Re("image-preview",void 0,Ve,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:o,previewSrc:s,show:l,appear:ar(),displayed:c,previewedImgProps:_==null?void 0:_.previewedImgPropsRef,handleWheel(m){m.preventDefault()},handlePreviewMousedown:v,handlePreviewDblclick:j,syncTransformOrigin:a,handleAfterLeave:()=>{N(),F=0,c.value=!1},handleDragStart:m=>{var C,b;(b=(C=_==null?void 0:_.previewedImgPropsRef.value)===null||C===void 0?void 0:C.onDragstart)===null||b===void 0||b.call(C,m),m.preventDefault()},zoomIn:Pe,zoomOut:$e,rotateCounterclockwise:Y,rotateClockwise:ae,handleSwitchPrev:H,handleSwitchNext:Z,withTooltip:Vt,resizeToOrignalImageSize:Ht,cssVars:Ge?void 0:Ve,themeClass:se==null?void 0:se.themeClass,onRender:se==null?void 0:se.onRender},Wt)},render(){var e,i;const{clsPrefix:t}=this;return n(De,null,(i=(e=this.$slots).default)===null||i===void 0?void 0:i.call(e),n(sr,{show:this.show},{default:()=>{var r;return this.show||this.displayed?((r=this.onRender)===null||r===void 0||r.call(this),Ye(n("div",{class:[`${t}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},n(xe,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?n("div",{class:`${t}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?n(xe,{name:"fade-in-transition",appear:this.appear},{default:()=>{if(!this.show)return null;const{withTooltip:o}=this;return n("div",{class:`${t}-image-preview-toolbar`},this.onPrev?n(De,null,o(n(W,{clsPrefix:t,onClick:this.handleSwitchPrev},{default:()=>Vn}),"tipPrevious"),o(n(W,{clsPrefix:t,onClick:this.handleSwitchNext},{default:()=>Gn}),"tipNext")):null,o(n(W,{clsPrefix:t,onClick:this.rotateCounterclockwise},{default:()=>n(In,null)}),"tipCounterclockwise"),o(n(W,{clsPrefix:t,onClick:this.rotateClockwise},{default:()=>n(On,null)}),"tipClockwise"),o(n(W,{clsPrefix:t,onClick:this.resizeToOrignalImageSize},{default:()=>n(_n,null)}),"tipOriginalSize"),o(n(W,{clsPrefix:t,onClick:this.zoomOut},{default:()=>n(Bn,null)}),"tipZoomOut"),o(n(W,{clsPrefix:t,onClick:this.zoomIn},{default:()=>n(zn,null)}),"tipZoomIn"),o(n(W,{clsPrefix:t,onClick:this.toggleShow},{default:()=>Xn}),"tipClose"))}}):null,n(xe,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:o={}}=this;return Ye(n("div",{class:`${t}-image-preview-wrapper`,ref:"previewWrapperRef"},n("img",Object.assign({},o,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${t}-image-preview`,o.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[Ne,this.show]])}})),[[lr,{enabled:this.show}]])):null}}))}}),Mt=ye("n-image-group"),Zn=He,Yn=V({name:"ImageGroup",props:Zn,setup(e){let i;const{mergedClsPrefixRef:t}=oe(e),r=`c${Me()}`,o=dt(),s=u=>{var a;i=u,(a=c.value)===null||a===void 0||a.setPreviewSrc(u)};function l(u){if(!(o!=null&&o.proxy))return;const d=o.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${r}]:not([data-error=true])`);if(!d.length)return;const f=Array.from(d).findIndex(y=>y.dataset.previewSrc===i);~f?s(d[(f+u+d.length)%d.length].dataset.previewSrc):s(d[0].dataset.previewSrc)}Ce(Mt,{mergedClsPrefixRef:t,setPreviewSrc:s,setThumbnailEl:u=>{var a;(a=c.value)===null||a===void 0||a.setThumbnailEl(u)},toggleShow:()=>{var u;(u=c.value)===null||u===void 0||u.toggleShow()},groupId:r});const c=A(null);return{mergedClsPrefix:t,previewInstRef:c,next:()=>{l(1)},prev:()=>{l(-1)}}},render(){return n(Dt,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},this.$slots)}}),Kn=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},He),Qn=V({name:"Image",props:Kn,inheritAttrs:!1,setup(e){const i=A(null),t=A(!1),r=A(null),o=re(Mt,null),{mergedClsPrefixRef:s}=o||oe(e),l={click:()=>{if(e.previewDisabled||t.value)return;const a=e.previewSrc||e.src;if(o){o.setPreviewSrc(a),o.setThumbnailEl(i.value),o.toggleShow();return}const{value:d}=r;d&&(d.setPreviewSrc(a),d.setThumbnailEl(i.value),d.toggleShow())}},c=A(!e.lazy);Be(()=>{var a;(a=i.value)===null||a===void 0||a.setAttribute("data-group-id",(o==null?void 0:o.groupId)||"")}),Be(()=>{if(e.lazy&&e.intersectionObserverOptions){let a;const d=Ee(()=>{a==null||a(),a=void 0,a=En(i.value,e.intersectionObserverOptions,c)});Ue(()=>{d(),a==null||a()})}}),Ee(()=>{var a;e.src,(a=e.imgProps)===null||a===void 0||a.src,t.value=!1});const u=A(!1);return Ce(_t,{previewedImgPropsRef:U(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:s,groupId:o==null?void 0:o.groupId,previewInstRef:r,imageRef:i,showError:t,shouldStartLoading:c,loaded:u,mergedOnClick:a=>{var d,f;l.click(),(f=(d=e.imgProps)===null||d===void 0?void 0:d.onClick)===null||f===void 0||f.call(d,a)},mergedOnError:a=>{if(!c.value)return;t.value=!0;const{onError:d,imgProps:{onError:f}={}}=e;d==null||d(a),f==null||f(a)},mergedOnLoad:a=>{const{onLoad:d,imgProps:{onLoad:f}={}}=e;d==null||d(a),f==null||f(a),u.value=!0}},l)},render(){var e,i;const{mergedClsPrefix:t,imgProps:r={},loaded:o,$attrs:s,lazy:l}=this,c=(i=(e=this.$slots).placeholder)===null||i===void 0?void 0:i.call(e),u=this.src||r.src,a=n("img",Object.assign(Object.assign({},r),{ref:"imageRef",width:this.width||r.width,height:this.height||r.height,src:this.showError?this.fallbackSrc:l&&this.intersectionObserverOptions?this.shouldStartLoading?u:void 0:u,alt:this.alt||r.alt,"aria-label":this.alt||r.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:Dn&&l&&!this.intersectionObserverOptions?"lazy":"eager",style:[r.style||"",c&&!o?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return n("div",Object.assign({},s,{role:"none",class:[s.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?a:n(Dt,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:t,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>a}),!o&&c)}}),Jn=B([p("progress",{display:"inline-block"},[p("progress-icon",` color: var(--n-icon-color); transition: color .3s var(--n-bezier); `),z("line",` width: 100%; display: block; `,[p("progress-content",` display: flex; align-items: center; `,[p("progress-graph",{flex:1})]),p("progress-custom-content",{marginLeft:"14px"}),p("progress-icon",` width: 30px; padding-left: 14px; height: var(--n-icon-size-line); line-height: var(--n-icon-size-line); font-size: var(--n-icon-size-line); `,[z("as-text",` color: var(--n-text-color-line-outer); text-align: center; width: 40px; font-size: var(--n-font-size); padding-left: 4px; transition: color .3s var(--n-bezier); `)])]),z("circle, dashboard",{width:"120px"},[p("progress-custom-content",` position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); display: flex; align-items: center; justify-content: center; `),p("progress-text",` position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); display: flex; align-items: center; color: inherit; font-size: var(--n-font-size-circle); color: var(--n-text-color-circle); font-weight: var(--n-font-weight-circle); transition: color .3s var(--n-bezier); white-space: nowrap; `),p("progress-icon",` position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); display: flex; align-items: center; color: var(--n-icon-color); font-size: var(--n-icon-size-circle); `)]),z("multiple-circle",` width: 200px; color: inherit; `,[p("progress-text",` font-weight: var(--n-font-weight-circle); color: var(--n-text-color-circle); position: absolute; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); display: flex; align-items: center; justify-content: center; transition: color .3s var(--n-bezier); `)]),p("progress-content",{position:"relative"}),p("progress-graph",{position:"relative"},[p("progress-graph-circle",[B("svg",{verticalAlign:"bottom"}),p("progress-graph-circle-fill",` stroke: var(--n-fill-color); transition: opacity .3s var(--n-bezier), stroke .3s var(--n-bezier), stroke-dasharray .3s var(--n-bezier); `,[z("empty",{opacity:0})]),p("progress-graph-circle-rail",` transition: stroke .3s var(--n-bezier); overflow: hidden; stroke: var(--n-rail-color); `)]),p("progress-graph-line",[z("indicator-inside",[p("progress-graph-line-rail",` height: 16px; line-height: 16px; border-radius: 10px; `,[p("progress-graph-line-fill",` height: inherit; border-radius: 10px; `),p("progress-graph-line-indicator",` background: #0000; white-space: nowrap; text-align: right; margin-left: 14px; margin-right: 14px; height: inherit; font-size: 12px; color: var(--n-text-color-line-inner); transition: color .3s var(--n-bezier); `)])]),z("indicator-inside-label",` height: 16px; display: flex; align-items: center; `,[p("progress-graph-line-rail",` flex: 1; transition: background-color .3s var(--n-bezier); `),p("progress-graph-line-indicator",` background: var(--n-fill-color); font-size: 12px; transform: translateZ(0); display: flex; vertical-align: middle; height: 16px; line-height: 16px; padding: 0 10px; border-radius: 10px; position: absolute; white-space: nowrap; color: var(--n-text-color-line-inner); transition: right .2s var(--n-bezier), color .3s var(--n-bezier), background-color .3s var(--n-bezier); `)]),p("progress-graph-line-rail",` position: relative; overflow: hidden; height: var(--n-rail-height); border-radius: 5px; background-color: var(--n-rail-color); transition: background-color .3s var(--n-bezier); `,[p("progress-graph-line-fill",` background: var(--n-fill-color); position: relative; border-radius: 5px; height: inherit; width: 100%; max-width: 0%; transition: background-color .3s var(--n-bezier), max-width .2s var(--n-bezier); `,[z("processing",[B("&::after",` content: ""; background-image: var(--n-line-bg-processing); animation: progress-processing-animation 2s var(--n-bezier) infinite; `)])])])])])]),B("@keyframes progress-processing-animation",` 0% { position: absolute; left: 0; top: 0; bottom: 0; right: 100%; opacity: 1; } 66% { position: absolute; left: 0; top: 0; bottom: 0; right: 0; opacity: 0; } 100% { position: absolute; left: 0; top: 0; bottom: 0; right: 0; opacity: 0; } `)]),ei={success:n(ct,null),error:n(ft,null),warning:n(ht,null),info:n(pt,null)},ti=V({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:i}){const t=P(()=>le(e.height)),r=P(()=>e.railBorderRadius!==void 0?le(e.railBorderRadius):e.height!==void 0?le(e.height,{c:.5}):""),o=P(()=>e.fillBorderRadius!==void 0?le(e.fillBorderRadius):e.railBorderRadius!==void 0?le(e.railBorderRadius):e.height!==void 0?le(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:s,railColor:l,railStyle:c,percentage:u,unit:a,indicatorTextColor:d,status:f,showIndicator:y,fillColor:h,processing:S,clsPrefix:w}=e;return n("div",{class:`${w}-progress-content`,role:"none"},n("div",{class:`${w}-progress-graph`,"aria-hidden":!0},n("div",{class:[`${w}-progress-graph-line`,{[`${w}-progress-graph-line--indicator-${s}`]:!0}]},n("div",{class:`${w}-progress-graph-line-rail`,style:[{backgroundColor:l,height:t.value,borderRadius:r.value},c]},n("div",{class:[`${w}-progress-graph-line-fill`,S&&`${w}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:h,height:t.value,lineHeight:t.value,borderRadius:o.value}},s==="inside"?n("div",{class:`${w}-progress-graph-line-indicator`,style:{color:d}},u,a):null)))),y&&s==="outside"?n("div",null,i.default?n("div",{class:`${w}-progress-custom-content`,style:{color:d},role:"none"},i.default()):f==="default"?n("div",{role:"none",class:`${w}-progress-icon ${w}-progress-icon--as-text`,style:{color:d}},u,a):n("div",{class:`${w}-progress-icon`,"aria-hidden":!0},n(W,{clsPrefix:w},{default:()=>ei[f]}))):null)}}}),ri={success:n(ct,null),error:n(ft,null),warning:n(ht,null),info:n(pt,null)},ni=V({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:i}){function t(r,o,s){const{gapDegree:l,viewBoxWidth:c,strokeWidth:u}=e,a=50,d=0,f=a,y=0,h=2*a,S=50+u/2,w=`M ${S},${S} m ${d},${f} a ${a},${a} 0 1 1 ${y},${-h} a ${a},${a} 0 1 1 ${-y},${h}`,$=Math.PI*2*a,k={stroke:s,strokeDasharray:`${r/100*($-l)}px ${c*8}px`,strokeDashoffset:`-${l/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:w,pathStyle:k}}return()=>{const{fillColor:r,railColor:o,strokeWidth:s,offsetDegree:l,status:c,percentage:u,showIndicator:a,indicatorTextColor:d,unit:f,gapOffsetDegree:y,clsPrefix:h}=e,{pathString:S,pathStyle:w}=t(100,0,o),{pathString:$,pathStyle:k}=t(u,l,r),x=100+s;return n("div",{class:`${h}-progress-content`,role:"none"},n("div",{class:`${h}-progress-graph`,"aria-hidden":!0},n("div",{class:`${h}-progress-graph-circle`,style:{transform:y?`rotate(${y}deg)`:void 0}},n("svg",{viewBox:`0 0 ${x} ${x}`},n("g",null,n("path",{class:`${h}-progress-graph-circle-rail`,d:S,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:w})),n("g",null,n("path",{class:[`${h}-progress-graph-circle-fill`,u===0&&`${h}-progress-graph-circle-fill--empty`],d:$,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:k}))))),a?n("div",null,i.default?n("div",{class:`${h}-progress-custom-content`,role:"none"},i.default()):c!=="default"?n("div",{class:`${h}-progress-icon`,"aria-hidden":!0},n(W,{clsPrefix:h},{default:()=>ri[c]})):n("div",{class:`${h}-progress-text`,style:{color:d},role:"none"},n("span",{class:`${h}-progress-text__percentage`},u),n("span",{class:`${h}-progress-text__unit`},f))):null)}}});function it(e,i,t=100){return`m ${t/2} ${t/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const ii=V({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:i}){const t=P(()=>e.percentage.map((o,s)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*s)-e.circleGap*s)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:r,strokeWidth:o,circleGap:s,showIndicator:l,fillColor:c,railColor:u,railStyle:a,percentage:d,clsPrefix:f}=e;return n("div",{class:`${f}-progress-content`,role:"none"},n("div",{class:`${f}-progress-graph`,"aria-hidden":!0},n("div",{class:`${f}-progress-graph-circle`},n("svg",{viewBox:`0 0 ${r} ${r}`},d.map((y,h)=>n("g",{key:h},n("path",{class:`${f}-progress-graph-circle-rail`,d:it(r/2-o/2*(1+2*h)-s*h,o,r),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:u[h]},a[h]]}),n("path",{class:[`${f}-progress-graph-circle-fill`,y===0&&`${f}-progress-graph-circle-fill--empty`],d:it(r/2-o/2*(1+2*h)-s*h,o,r),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:t.value[h],strokeDashoffset:0,stroke:c[h]}})))))),l&&i.default?n("div",null,n("div",{class:`${f}-progress-text`},i.default())):null)}}}),oi=Object.assign(Object.assign({},ne.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),ai=V({name:"Progress",props:oi,setup(e){const i=P(()=>e.indicatorPlacement||e.indicatorPosition),t=P(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:r,inlineThemeDisabled:o}=oe(e),s=ne("Progress","-progress",Jn,ur,e,r),l=P(()=>{const{status:u}=e,{common:{cubicBezierEaseInOut:a},self:{fontSize:d,fontSizeCircle:f,railColor:y,railHeight:h,iconSizeCircle:S,iconSizeLine:w,textColorCircle:$,textColorLineInner:k,textColorLineOuter:x,lineBgProcessing:L,fontWeightCircle:T,[je("iconColor",u)]:g,[je("fillColor",u)]:R}}=s.value;return{"--n-bezier":a,"--n-fill-color":R,"--n-font-size":d,"--n-font-size-circle":f,"--n-font-weight-circle":T,"--n-icon-color":g,"--n-icon-size-circle":S,"--n-icon-size-line":w,"--n-line-bg-processing":L,"--n-rail-color":y,"--n-rail-height":h,"--n-text-color-circle":$,"--n-text-color-line-inner":k,"--n-text-color-line-outer":x}}),c=o?Re("progress",P(()=>e.status[0]),l,e):void 0;return{mergedClsPrefix:r,mergedIndicatorPlacement:i,gapDeg:t,cssVars:o?void 0:l,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{type:e,cssVars:i,indicatorTextColor:t,showIndicator:r,status:o,railColor:s,railStyle:l,color:c,percentage:u,viewBoxWidth:a,strokeWidth:d,mergedIndicatorPlacement:f,unit:y,borderRadius:h,fillBorderRadius:S,height:w,processing:$,circleGap:k,mergedClsPrefix:x,gapDeg:L,gapOffsetDegree:T,themeClass:g,$slots:R,onRender:O}=this;return O==null||O(),n("div",{class:[g,`${x}-progress`,`${x}-progress--${e}`,`${x}-progress--${o}`],style:i,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":u,role:e==="circle"||e==="line"||e==="dashboard"?"progressbar":"none"},e==="circle"||e==="dashboard"?n(ni,{clsPrefix:x,status:o,showIndicator:r,indicatorTextColor:t,railColor:s,fillColor:c,railStyle:l,offsetDegree:this.offsetDegree,percentage:u,viewBoxWidth:a,strokeWidth:d,gapDegree:L===void 0?e==="dashboard"?75:0:L,gapOffsetDegree:T,unit:y},R):e==="line"?n(ti,{clsPrefix:x,status:o,showIndicator:r,indicatorTextColor:t,railColor:s,fillColor:c,railStyle:l,percentage:u,processing:$,indicatorPlacement:f,unit:y,fillBorderRadius:S,railBorderRadius:h,height:w},R):e==="multiple-circle"?n(ii,{clsPrefix:x,strokeWidth:d,railColor:s,fillColor:c,railStyle:l,viewBoxWidth:a,percentage:u,showIndicator:r,circleGap:k},R):null)}}),si=B([B("@keyframes spin-rotate",` from { transform: rotate(0); } to { transform: rotate(360deg); } `),p("spin-container",{position:"relative"},[p("spin-body",` position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); `,[_e()])]),p("spin-body",` display: inline-flex; align-items: center; justify-content: center; flex-direction: column; `),p("spin",` display: inline-flex; height: var(--n-size); width: var(--n-size); font-size: var(--n-size); color: var(--n-color); `,[z("rotate",` animation: spin-rotate 2s linear infinite; `)]),p("spin-description",` display: inline-block; font-size: var(--n-font-size); color: var(--n-text-color); transition: color .3s var(--n-bezier); margin-top: 8px; `),p("spin-content",` opacity: 1; transition: opacity .3s var(--n-bezier); pointer-events: all; `,[z("spinning",` user-select: none; -webkit-user-select: none; pointer-events: none; opacity: var(--n-opacity-spinning); `)])]),li={small:20,medium:18,large:16},di=Object.assign(Object.assign({},ne.props),{description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0}}),ji=V({name:"Spin",props:di,setup(e){const{mergedClsPrefixRef:i,inlineThemeDisabled:t}=oe(e),r=ne("Spin","-spin",si,cr,e,i),o=P(()=>{const{size:l}=e,{common:{cubicBezierEaseInOut:c},self:u}=r.value,{opacitySpinning:a,color:d,textColor:f}=u,y=typeof l=="number"?ie(l):u[je("size",l)];return{"--n-bezier":c,"--n-opacity-spinning":a,"--n-size":y,"--n-color":d,"--n-text-color":f}}),s=t?Re("spin",P(()=>{const{size:l}=e;return typeof l=="number"?String(l):l[0]}),o,e):void 0;return{mergedClsPrefix:i,compitableShow:fr(e,["spinning","show"]),mergedStrokeWidth:P(()=>{const{strokeWidth:l}=e;if(l!==void 0)return l;const{size:c}=e;return li[typeof c=="number"?"medium":c]}),cssVars:t?void 0:o,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e,i;const{$slots:t,mergedClsPrefix:r,description:o}=this,s=t.icon&&this.rotate,l=(o||t.description)&&n("div",{class:`${r}-spin-description`},o||((e=t.description)===null||e===void 0?void 0:e.call(t))),c=t.icon?n("div",{class:[`${r}-spin-body`,this.themeClass]},n("div",{class:[`${r}-spin`,s&&`${r}-spin--rotate`],style:t.default?"":this.cssVars},t.icon()),l):n("div",{class:[`${r}-spin-body`,this.themeClass]},n(hr,{clsPrefix:r,style:t.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),l);return(i=this.onRender)===null||i===void 0||i.call(this),t.default?n("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},n("div",{class:[`${r}-spin-content`,this.compitableShow&&`${r}-spin-content--spinning`]},t),n(xe,{name:"fade-in-transition"},{default:()=>this.compitableShow?c:null})):c}}),ue=ye("n-upload"),Et="__UPLOAD_DRAGGER__",ui=V({name:"UploadDragger",[Et]:!0,setup(e,{slots:i}){const t=re(ue,null);return t||Se("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:r},mergedDisabledRef:{value:o},maxReachedRef:{value:s}}=t;return n("div",{class:[`${r}-upload-dragger`,(o||s)&&`${r}-upload-dragger--disabled`]},i)}}});var jt=globalThis&&globalThis.__awaiter||function(e,i,t,r){function o(s){return s instanceof t?s:new t(function(l){l(s)})}return new(t||(t=Promise))(function(s,l){function c(d){try{a(r.next(d))}catch(f){l(f)}}function u(d){try{a(r.throw(d))}catch(f){l(f)}}function a(d){d.done?s(d.value):o(d.value).then(c,u)}a((r=r.apply(e,i||[])).next())})};const Nt=e=>e.includes("image/"),ot=(e="")=>{const i=e.split("/"),r=i[i.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},at=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,Ut=e=>{if(e.type)return Nt(e.type);const i=ot(e.name||"");if(at.test(i))return!0;const t=e.thumbnailUrl||e.url||"",r=ot(t);return!!(/^data:image\//.test(t)||at.test(r))};function ci(e){return jt(this,void 0,void 0,function*(){return yield new Promise(i=>{if(!e.type||!Nt(e.type)){i("");return}i(window.URL.createObjectURL(e))})})}const fi=Ae&&window.FileReader&&window.File;function hi(e){return e.isDirectory}function pi(e){return e.isFile}function gi(e,i){return jt(this,void 0,void 0,function*(){const t=[];let r,o=0;function s(){o++}function l(){o--,o||r(t)}function c(u){u.forEach(a=>{if(a){if(s(),i&&hi(a)){const d=a.createReader();s(),d.readEntries(f=>{c(f),l()},()=>{l()})}else pi(a)&&(s(),a.file(d=>{t.push({file:d,entry:a,source:"dnd"}),l()},()=>{l()}));l()}})}return yield new Promise(u=>{r=u,c(e)}),t})}function pe(e){const{id:i,name:t,percentage:r,status:o,url:s,file:l,thumbnailUrl:c,type:u,fullPath:a,batchId:d}=e;return{id:i,name:t,percentage:r??null,status:o,url:s??null,file:l??null,thumbnailUrl:c??null,type:u??null,fullPath:a??null,batchId:d??null}}function vi(e,i,t){return e=e.toLowerCase(),i=i.toLocaleLowerCase(),t=t.toLocaleLowerCase(),t.split(",").map(o=>o.trim()).filter(Boolean).some(o=>{if(o.startsWith(".")){if(e.endsWith(o))return!0}else if(o.includes("/")){const[s,l]=i.split("/"),[c,u]=o.split("/");if((c==="*"||s&&c&&c===s)&&(u==="*"||l&&u&&u===l))return!0}else return!0;return!1})}const mi=(e,i)=>{if(!e)return;const t=document.createElement("a");t.href=e,i!==void 0&&(t.download=i),document.body.appendChild(t),t.click(),document.body.removeChild(t)},At=V({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:i}){const t=re(ue,null);t||Se("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:r,mergedDisabledRef:o,maxReachedRef:s,listTypeRef:l,dragOverRef:c,openOpenFileDialog:u,draggerInsideRef:a,handleFileAddition:d,mergedDirectoryDndRef:f,triggerStyleRef:y}=t,h=P(()=>l.value==="image-card");function S(){o.value||s.value||u()}function w(L){L.preventDefault(),c.value=!0}function $(L){L.preventDefault(),c.value=!0}function k(L){L.preventDefault(),c.value=!1}function x(L){var T;if(L.preventDefault(),!a.value||o.value||s.value){c.value=!1;return}const g=(T=L.dataTransfer)===null||T===void 0?void 0:T.items;g!=null&&g.length?gi(Array.from(g).map(R=>R.webkitGetAsEntry()),f.value).then(R=>{d(R)}).finally(()=>{c.value=!1}):c.value=!1}return()=>{var L;const{value:T}=r;return e.abstract?(L=i.default)===null||L===void 0?void 0:L.call(i,{handleClick:S,handleDrop:x,handleDragOver:w,handleDragEnter:$,handleDragLeave:k}):n("div",{class:[`${T}-upload-trigger`,(o.value||s.value)&&`${T}-upload-trigger--disabled`,h.value&&`${T}-upload-trigger--image-card`],style:y.value,onClick:S,onDrop:x,onDragover:w,onDragenter:$,onDragleave:k},h.value?n(ui,null,{default:()=>pr(i.default,()=>[n(W,{clsPrefix:T},{default:()=>n(kr,null)})])}):i)}}}),bi=V({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:re(ue).mergedThemeRef}},render(){return n(gt,null,{default:()=>this.show?n(ai,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),wi=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},n("g",{fill:"none"},n("path",{d:"M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",fill:"currentColor"}))),xi=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},n("g",{fill:"none"},n("path",{d:"M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",fill:"currentColor"})));var yi=globalThis&&globalThis.__awaiter||function(e,i,t,r){function o(s){return s instanceof t?s:new t(function(l){l(s)})}return new(t||(t=Promise))(function(s,l){function c(d){try{a(r.next(d))}catch(f){l(f)}}function u(d){try{a(r.throw(d))}catch(f){l(f)}}function a(d){d.done?s(d.value):o(d.value).then(c,u)}a((r=r.apply(e,i||[])).next())})};const we={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"},Ci=V({name:"UploadFile",props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0}},setup(e){const i=re(ue),t=A(null),r=A(""),o=P(()=>{const{file:g}=e;return g.status==="finished"?"success":g.status==="error"?"error":"info"}),s=P(()=>{const{file:g}=e;if(g.status==="error")return"error"}),l=P(()=>{const{file:g}=e;return g.status==="uploading"}),c=P(()=>{if(!i.showCancelButtonRef.value)return!1;const{file:g}=e;return["uploading","pending","error"].includes(g.status)}),u=P(()=>{if(!i.showRemoveButtonRef.value)return!1;const{file:g}=e;return["finished"].includes(g.status)}),a=P(()=>{if(!i.showDownloadButtonRef.value)return!1;const{file:g}=e;return["finished"].includes(g.status)}),d=P(()=>{if(!i.showRetryButtonRef.value)return!1;const{file:g}=e;return["error"].includes(g.status)}),f=he(()=>r.value||e.file.thumbnailUrl||e.file.url),y=P(()=>{if(!i.showPreviewButtonRef.value)return!1;const{file:{status:g},listType:R}=e;return["finished"].includes(g)&&f.value&&R==="image-card"});function h(){i.submit(e.file.id)}function S(g){g.preventDefault();const{file:R}=e;["finished","pending","error"].includes(R.status)?$(R):["uploading"].includes(R.status)?x(R):mr("upload","The button clicked type is unknown.")}function w(g){g.preventDefault(),k(e.file)}function $(g){const{xhrMap:R,doChange:O,onRemoveRef:{value:_},mergedFileListRef:{value:v}}=i;Promise.resolve(_?_({file:Object.assign({},g),fileList:v}):!0).then(j=>{if(j===!1)return;const D=Object.assign({},g,{status:"removed"});R.delete(g.id),O(D,void 0,{remove:!0})})}function k(g){const{onDownloadRef:{value:R}}=i;Promise.resolve(R?R(Object.assign({},g)):!0).then(O=>{O!==!1&&mi(g.url,g.name)})}function x(g){const{xhrMap:R}=i,O=R.get(g.id);O==null||O.abort(),$(Object.assign({},g))}function L(){const{onPreviewRef:{value:g}}=i;if(g)g(e.file);else if(e.listType==="image-card"){const{value:R}=t;if(!R)return;R.click()}}const T=()=>yi(this,void 0,void 0,function*(){const{listType:g}=e;g!=="image"&&g!=="image-card"||i.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield i.getFileThumbnailUrlResolver(e.file))});return Ee(()=>{T()}),{mergedTheme:i.mergedThemeRef,progressStatus:o,buttonType:s,showProgress:l,disabled:i.mergedDisabledRef,showCancelButton:c,showRemoveButton:u,showDownloadButton:a,showRetryButton:d,showPreviewButton:y,mergedThumbnailUrl:f,shouldUseThumbnailUrl:i.shouldUseThumbnailUrlRef,renderIcon:i.renderIconRef,imageRef:t,handleRemoveOrCancelClick:S,handleDownloadClick:w,handleRetryClick:h,handlePreviewClick:L}},render(){const{clsPrefix:e,mergedTheme:i,listType:t,file:r,renderIcon:o}=this;let s;const l=t==="image";l||t==="image-card"?s=!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?n("span",{class:`${e}-upload-file-info__thumbnail`},o?o(r):Ut(r)?n(W,{clsPrefix:e},{default:()=>wi}):n(W,{clsPrefix:e},{default:()=>xi})):n("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},t==="image-card"?n(Qn,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:"imageRef"}):n("img",{src:this.mergedThumbnailUrl||void 0,alt:r.name})):s=n("span",{class:`${e}-upload-file-info__thumbnail`},o?o(r):n(W,{clsPrefix:e},{default:()=>n(kn,null)}));const u=n(bi,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),a=t==="text"||t==="image";return n("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!=="error"&&t!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${t}-type`]},n("div",{class:`${e}-upload-file-info`},s,n("div",{class:`${e}-upload-file-info__name`},a&&(r.url&&r.status!=="error"?n("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,onClick:this.handlePreviewClick},r.name):n("span",{onClick:this.handlePreviewClick},r.name)),l&&u),n("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${t}-type`]},this.showPreviewButton?n(me,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,builtinThemeOverrides:we},{icon:()=>n(W,{clsPrefix:e},{default:()=>n(gr,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&n(me,{key:"cancelOrTrash",theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:we,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>n(vr,null,{default:()=>this.showRemoveButton?n(W,{clsPrefix:e,key:"trash"},{default:()=>n(Pn,null)}):n(W,{clsPrefix:e,key:"cancel"},{default:()=>n(Ln,null)})})}),this.showRetryButton&&!this.disabled&&n(me,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,builtinThemeOverrides:we},{icon:()=>n(W,{clsPrefix:e},{default:()=>n(Tn,null)})}),this.showDownloadButton?n(me,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,builtinThemeOverrides:we},{icon:()=>n(W,{clsPrefix:e},{default:()=>n($n,null)})}):null)),!l&&u)}}),Ri=V({name:"UploadFileList",setup(e,{slots:i}){const t=re(ue,null);t||Se("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:r,mergedClsPrefixRef:o,listTypeRef:s,mergedFileListRef:l,fileListStyleRef:c,cssVarsRef:u,themeClassRef:a,maxReachedRef:d,showTriggerRef:f,imageGroupPropsRef:y}=t,h=P(()=>s.value==="image-card"),S=()=>l.value.map($=>n(Ci,{clsPrefix:o.value,key:$.id,file:$,listType:s.value})),w=()=>h.value?n(Yn,Object.assign({},y.value),{default:S}):n(gt,{group:!0},{default:S});return()=>{const{value:$}=o,{value:k}=r;return n("div",{class:[`${$}-upload-file-list`,h.value&&`${$}-upload-file-list--grid`,k?a==null?void 0:a.value:void 0],style:[k&&u?u.value:"",c.value]},w(),f.value&&!d.value&&h.value&&n(At,null,i))}}}),Si=B([p("upload","width: 100%;",[z("dragger-inside",[p("upload-trigger",` display: block; `)]),z("drag-over",[p("upload-dragger",` border: var(--n-dragger-border-hover); `)])]),p("upload-dragger",` cursor: pointer; box-sizing: border-box; width: 100%; text-align: center; border-radius: var(--n-border-radius); padding: 24px; opacity: 1; transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier), background-color .3s var(--n-bezier); background-color: var(--n-dragger-color); border: var(--n-dragger-border); `,[B("&:hover",` border: var(--n-dragger-border-hover); `),z("disabled",` cursor: not-allowed; `)]),p("upload-trigger",` display: inline-block; box-sizing: border-box; opacity: 1; transition: opacity .3s var(--n-bezier); `,[B("+",[p("upload-file-list","margin-top: 8px;")]),z("disabled",` opacity: var(--n-item-disabled-opacity); cursor: not-allowed; `),z("image-card",` width: 96px; height: 96px; `,[p("base-icon",` font-size: 24px; `),p("upload-dragger",` padding: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; `)])]),p("upload-file-list",` line-height: var(--n-line-height); opacity: 1; transition: opacity .3s var(--n-bezier); `,[B("a, img","outline: none;"),z("disabled",` opacity: var(--n-item-disabled-opacity); cursor: not-allowed; `,[p("upload-file","cursor: not-allowed;")]),z("grid",` display: grid; grid-template-columns: repeat(auto-fill, 96px); grid-gap: 8px; margin-top: 0; `),p("upload-file",` display: block; box-sizing: border-box; cursor: default; padding: 0px 12px 0 6px; transition: background-color .3s var(--n-bezier); border-radius: var(--n-border-radius); `,[Ke(),p("progress",[Ke({foldPadding:!0})]),B("&:hover",` background-color: var(--n-item-color-hover); `,[p("upload-file-info",[J("action",` opacity: 1; `)])]),z("image-type",` border-radius: var(--n-border-radius); text-decoration: underline; text-decoration-color: #0000; `,[p("upload-file-info",` padding-top: 0px; padding-bottom: 0px; width: 100%; height: 100%; display: flex; justify-content: space-between; align-items: center; padding: 6px 0; `,[p("progress",` padding: 2px 0; margin-bottom: 0; `),J("name",` padding: 0 8px; `),J("thumbnail",` width: 32px; height: 32px; font-size: 28px; display: flex; justify-content: center; align-items: center; `,[B("img",` width: 100%; `)])])]),z("text-type",[p("progress",` box-sizing: border-box; padding-bottom: 6px; margin-bottom: 6px; `)]),z("image-card-type",` position: relative; width: 96px; height: 96px; border: var(--n-item-border-image-card); border-radius: var(--n-border-radius); padding: 0; display: flex; align-items: center; justify-content: center; transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier); border-radius: var(--n-border-radius); overflow: hidden; `,[p("progress",` position: absolute; left: 8px; bottom: 8px; right: 8px; width: unset; `),p("upload-file-info",` padding: 0; width: 100%; height: 100%; `,[J("thumbnail",` width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 36px; `,[B("img",` width: 100%; `)])]),B("&::before",` position: absolute; z-index: 1; left: 0; right: 0; top: 0; bottom: 0; border-radius: inherit; opacity: 0; transition: opacity .2s var(--n-bezier); content: ""; `),B("&:hover",[B("&::before","opacity: 1;"),p("upload-file-info",[J("thumbnail","opacity: .12;")])])]),z("error-status",[B("&:hover",` background-color: var(--n-item-color-hover-error); `),p("upload-file-info",[J("name","color: var(--n-item-text-color-error);"),J("thumbnail","color: var(--n-item-text-color-error);")]),z("image-card-type",` border: var(--n-item-border-image-card-error); `)]),z("with-url",` cursor: pointer; `,[p("upload-file-info",[J("name",` color: var(--n-item-text-color-success); text-decoration-color: var(--n-item-text-color-success); `,[B("a",` text-decoration: underline; `)])])]),p("upload-file-info",` position: relative; padding-top: 6px; padding-bottom: 6px; display: flex; flex-wrap: nowrap; `,[J("thumbnail",` font-size: 18px; opacity: 1; transition: opacity .2s var(--n-bezier); color: var(--n-item-icon-color); `,[p("base-icon",` margin-right: 2px; vertical-align: middle; transition: color .3s var(--n-bezier); `)]),J("action",` padding-top: inherit; padding-bottom: inherit; position: absolute; right: 0; top: 0; bottom: 0; width: 80px; display: flex; align-items: center; transition: opacity .2s var(--n-bezier); justify-content: flex-end; opacity: 0; `,[p("button",[B("&:not(:last-child)",{marginRight:"4px"}),p("base-icon",[B("svg",[br()])])]),z("image-type",` position: relative; max-width: 80px; width: auto; `),z("image-card-type",` z-index: 2; position: absolute; width: 100%; height: 100%; left: 0; right: 0; bottom: 0; top: 0; display: flex; justify-content: center; align-items: center; `)]),J("name",` color: var(--n-item-text-color); flex: 1; display: flex; justify-content: center; text-overflow: ellipsis; overflow: hidden; flex-direction: column; text-decoration-color: #0000; font-size: var(--n-font-size); transition: color .3s var(--n-bezier), text-decoration-color .3s var(--n-bezier); `,[B("a",` color: inherit; text-decoration: underline; `)])])])]),p("upload-file-input",` display: block; width: 0; height: 0; opacity: 0; `)]);var st=globalThis&&globalThis.__awaiter||function(e,i,t,r){function o(s){return s instanceof t?s:new t(function(l){l(s)})}return new(t||(t=Promise))(function(s,l){function c(d){try{a(r.next(d))}catch(f){l(f)}}function u(d){try{a(r.throw(d))}catch(f){l(f)}}function a(d){d.done?s(d.value):o(d.value).then(c,u)}a((r=r.apply(e,i||[])).next())})};function ki(e,i,t){const{doChange:r,xhrMap:o}=e;let s=0;function l(u){var a;let d=Object.assign({},i,{status:"error",percentage:s});o.delete(i.id),d=pe(((a=e.onError)===null||a===void 0?void 0:a.call(e,{file:d,event:u}))||d),r(d,u)}function c(u){var a;if(e.isErrorState){if(e.isErrorState(t)){l(u);return}}else if(t.status<200||t.status>=300){l(u);return}let d=Object.assign({},i,{status:"finished",percentage:s});o.delete(i.id),d=pe(((a=e.onFinish)===null||a===void 0?void 0:a.call(e,{file:d,event:u}))||d),r(d,u)}return{handleXHRLoad:c,handleXHRError:l,handleXHRAbort(u){const a=Object.assign({},i,{status:"removed",file:null,percentage:s});o.delete(i.id),r(a,u)},handleXHRProgress(u){const a=Object.assign({},i,{status:"uploading"});if(u.lengthComputable){const d=Math.ceil(u.loaded/u.total*100);a.percentage=d,s=d}r(a,u)}}}function Pi(e){const{inst:i,file:t,data:r,headers:o,withCredentials:s,action:l,customRequest:c}=e,{doChange:u}=e.inst;let a=0;c({file:t,data:r,headers:o,withCredentials:s,action:l,onProgress(d){const f=Object.assign({},t,{status:"uploading"}),y=d.percent;f.percentage=y,a=y,u(f)},onFinish(){var d;let f=Object.assign({},t,{status:"finished",percentage:a});f=pe(((d=i.onFinish)===null||d===void 0?void 0:d.call(i,{file:f}))||f),u(f)},onError(){var d;let f=Object.assign({},t,{status:"error",percentage:a});f=pe(((d=i.onError)===null||d===void 0?void 0:d.call(i,{file:f}))||f),u(f)}})}function $i(e,i,t){const r=ki(e,i,t);t.onabort=r.handleXHRAbort,t.onerror=r.handleXHRError,t.onload=r.handleXHRLoad,t.upload&&(t.upload.onprogress=r.handleXHRProgress)}function Ft(e,i){return typeof e=="function"?e({file:i}):e||{}}function Li(e,i,t){const r=Ft(i,t);r&&Object.keys(r).forEach(o=>{e.setRequestHeader(o,r[o])})}function Ti(e,i,t){const r=Ft(i,t);r&&Object.keys(r).forEach(o=>{e.append(o,r[o])})}function Oi(e,i,t,{method:r,action:o,withCredentials:s,responseType:l,headers:c,data:u}){const a=new XMLHttpRequest;a.responseType=l,e.xhrMap.set(t.id,a),a.withCredentials=s;const d=new FormData;if(Ti(d,u,t),d.append(i,t.file),$i(e,t,a),o!==void 0){a.open(r.toUpperCase(),o),Li(a,c,t),a.send(d);const f=Object.assign({},t,{status:"uploading"});e.doChange(f)}}const Ii=Object.assign(Object.assign({},ne.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>fi?Ut(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),Ni=V({name:"Upload",props:Ii,setup(e){e.abstract&&e.listType==="image-card"&&Se("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:i,inlineThemeDisabled:t}=oe(e),r=ne("Upload","-upload",Si,wr,e,i),o=xr(e),s=P(()=>{const{max:v}=e;return v!==void 0?h.value.length>=v:!1}),l=A(e.defaultFileList),c=U(e,"fileList"),u=A(null),a={value:!1},d=A(!1),f=new Map,y=yr(c,l),h=P(()=>y.value.map(pe));function S(){var v;(v=u.value)===null||v===void 0||v.click()}function w(v){const j=v.target;x(j.files?Array.from(j.files).map(D=>({file:D,entry:null,source:"input"})):null,v),j.value=""}function $(v){const{"onUpdate:fileList":j,onUpdateFileList:D}=e;j&&Qe(j,v),D&&Qe(D,v),l.value=v}const k=P(()=>e.multiple||e.directory);function x(v,j){if(!v||v.length===0)return;const{onBeforeUpload:D}=e;v=k.value?v:[v[0]];const{max:G,accept:I}=e;v=v.filter(({file:N,source:H})=>H==="dnd"&&(I!=null&&I.trim())?vi(N.name,N.type,I):!0),G&&(v=v.slice(0,G-h.value.length));const F=Me();Promise.all(v.map(({file:N,entry:H})=>st(this,void 0,void 0,function*(){var Z;const Y={id:Me(),batchId:F,name:N.name,status:"pending",percentage:0,file:N,url:null,type:N.type,thumbnailUrl:null,fullPath:(Z=H==null?void 0:H.fullPath)!==null&&Z!==void 0?Z:`/${N.webkitRelativePath||N.name}`};return!D||(yield D({file:Y,fileList:h.value}))!==!1?Y:null}))).then(N=>st(this,void 0,void 0,function*(){let H=Promise.resolve();N.forEach(Z=>{H=H.then(Rr).then(()=>{Z&&T(Z,j,{append:!0})})}),yield H})).then(()=>{e.defaultUpload&&L()})}function L(v){const{method:j,action:D,withCredentials:G,headers:I,data:F,name:N}=e,H=v!==void 0?h.value.filter(Y=>Y.id===v):h.value,Z=v!==void 0;H.forEach(Y=>{const{status:ae}=Y;(ae==="pending"||ae==="error"&&Z)&&(e.customRequest?Pi({inst:{doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:Y,action:D,withCredentials:G,headers:I,data:F,customRequest:e.customRequest}):Oi({doChange:T,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},N,Y,{method:j,action:D,withCredentials:G,responseType:e.responseType,headers:I,data:F}))})}const T=(v,j,D={append:!1,remove:!1})=>{const{append:G,remove:I}=D,F=Array.from(h.value),N=F.findIndex(H=>H.id===v.id);if(G||I||~N){G?F.push(v):I?F.splice(N,1):F.splice(N,1,v);const{onChange:H}=e;H&&H({file:v,fileList:F,event:j}),$(F)}};function g(v){var j;if(v.thumbnailUrl)return v.thumbnailUrl;const{createThumbnailUrl:D}=e;return D?(j=D(v.file,v))!==null&&j!==void 0?j:v.url||"":v.url?v.url:v.file?ci(v.file):""}const R=P(()=>{const{common:{cubicBezierEaseInOut:v},self:{draggerColor:j,draggerBorder:D,draggerBorderHover:G,itemColorHover:I,itemColorHoverError:F,itemTextColorError:N,itemTextColorSuccess:H,itemTextColor:Z,itemIconColor:Y,itemDisabledOpacity:ae,lineHeight:ke,borderRadius:ge,fontSize:Pe,itemBorderImageCardError:$e,itemBorderImageCard:q}}=r.value;return{"--n-bezier":v,"--n-border-radius":ge,"--n-dragger-border":D,"--n-dragger-border-hover":G,"--n-dragger-color":j,"--n-font-size":Pe,"--n-item-color-hover":I,"--n-item-color-hover-error":F,"--n-item-disabled-opacity":ae,"--n-item-icon-color":Y,"--n-item-text-color":Z,"--n-item-text-color-error":N,"--n-item-text-color-success":H,"--n-line-height":ke,"--n-item-border-image-card-error":$e,"--n-item-border-image-card":q}}),O=t?Re("upload",void 0,R,e):void 0;Ce(ue,{mergedClsPrefixRef:i,mergedThemeRef:r,showCancelButtonRef:U(e,"showCancelButton"),showDownloadButtonRef:U(e,"showDownloadButton"),showRemoveButtonRef:U(e,"showRemoveButton"),showRetryButtonRef:U(e,"showRetryButton"),onRemoveRef:U(e,"onRemove"),onDownloadRef:U(e,"onDownload"),mergedFileListRef:h,triggerStyleRef:U(e,"triggerStyle"),shouldUseThumbnailUrlRef:U(e,"shouldUseThumbnailUrl"),renderIconRef:U(e,"renderIcon"),xhrMap:f,submit:L,doChange:T,showPreviewButtonRef:U(e,"showPreviewButton"),onPreviewRef:U(e,"onPreview"),getFileThumbnailUrlResolver:g,listTypeRef:U(e,"listType"),dragOverRef:d,openOpenFileDialog:S,draggerInsideRef:a,handleFileAddition:x,mergedDisabledRef:o.mergedDisabledRef,maxReachedRef:s,fileListStyleRef:U(e,"fileListStyle"),abstractRef:U(e,"abstract"),acceptRef:U(e,"accept"),cssVarsRef:t?void 0:R,themeClassRef:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender,showTriggerRef:U(e,"showTrigger"),imageGroupPropsRef:U(e,"imageGroupProps"),mergedDirectoryDndRef:P(()=>{var v;return(v=e.directoryDnd)!==null&&v!==void 0?v:e.directory})});const _={clear:()=>{l.value=[]},submit:L,openOpenFileDialog:S};return Object.assign({mergedClsPrefix:i,draggerInsideRef:a,inputElRef:u,mergedTheme:r,dragOver:d,mergedMultiple:k,cssVars:t?void 0:R,themeClass:O==null?void 0:O.themeClass,onRender:O==null?void 0:O.onRender,handleFileInputChange:w},_)},render(){var e,i;const{draggerInsideRef:t,mergedClsPrefix:r,$slots:o,directory:s,onRender:l}=this;if(o.default&&!this.abstract){const u=o.default()[0];!((e=u==null?void 0:u.type)===null||e===void 0)&&e[Et]&&(t.value=!0)}const c=n("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:s||void 0,directory:s||void 0}));return this.abstract?n(De,null,(i=o.default)===null||i===void 0?void 0:i.call(o),n(Cr,{to:"body"},c)):(l==null||l(),n("div",{class:[`${r}-upload`,t.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},c,this.showTrigger&&this.listType!=="image-card"&&n(At,null,o),this.showFileList&&n(Ri,null,o)))}}),Ui=e=>vt.request({method:"POST",url:"/VerifyTemplateMapData/List",data:e,baseURL:mt}),Ai=e=>vt.request({method:"POST",url:"/VerifyTemplateMapData/Pu",data:e,baseURL:mt});export{Ni as _,ai as a,ji as b,Qn as c,Mi as d,Ei as e,Ui as g,Ai as p};