123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480 |
- import{D as je,aV as Gt,z as P,b as A,e as Ue,aW as lt,aX as ee,h as n,d as V,P 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,T as oe,aa as he,au as Be,b4 as Ce,a8 as U,aH as qe,b5 as Kt,b6 as ut,b7 as Qt,b8 as Ze,X as ne,a3 as Jt,$ as er,b9 as tr,R as B,Q as p,ba as _e,aN as rr,V as nr,a6 as ir,I as or,ae as Le,bb as ve,Z as Re,bc as ar,bd as sr,C as Ye,be as lr,aQ as xe,F as De,ag as W,s as dr,bf as Me,bg as Ee,W as z,a1 as le,aM as ct,aJ as ft,aK as ht,aL as pt,bh as ur,a2 as Ne,bi as cr,bj as fr,bk as hr,bl as Se,af as pr,aB as gt,j as me,bm as gr,bn as vr,bo as mr,aF as Ke,S as J,bp as br,bq as wr,a7 as xr,a9 as yr,br as Cr,A as Rr,ai as Qe,ak as vt,ay as mt}from"./index-53f7e955.js";import{g as Sr}from"./get-slot-1efb97e5.js";import{A as kr}from"./Add-1ad42559.js";import{N as Pr}from"./Tooltip-1846d4e5.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===je);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<s;)t=i(t,e[o],o,e);return t}function Br(e){return function(i){return e==null?void 0:e[i]}}var _r={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Dr=Br(_r);const Mr=Dr;var Er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Nr="\\u0300-\\u036f",jr="\\ufe20-\\ufe2f",Ur="\\u20d0-\\u20ff",Ar=Nr+jr+Ur,Fr="["+Ar+"]",Hr=RegExp(Fr,"g");function Wr(e){return e=lt(e),e&&e.replace(Er,Mr).replace(Hr,"")}var Vr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Gr(e){return e.match(Vr)||[]}var Xr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function qr(e){return Xr.test(e)}var bt="\\ud800-\\udfff",Zr="\\u0300-\\u036f",Yr="\\ufe20-\\ufe2f",Kr="\\u20d0-\\u20ff",Qr=Zr+Yr+Kr,wt="\\u2700-\\u27bf",xt="a-z\\xdf-\\xf6\\xf8-\\xff",Jr="\\xac\\xb1\\xd7\\xf7",en="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tn="\\u2000-\\u206f",rn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yt="A-Z\\xc0-\\xd6\\xd8-\\xde",nn="\\ufe0e\\ufe0f",Ct=Jr+en+tn+rn,Rt="['’]",Je="["+Ct+"]",on="["+Qr+"]",St="\\d+",an="["+wt+"]",kt="["+xt+"]",Pt="[^"+bt+Ct+St+wt+xt+yt+"]",sn="\\ud83c[\\udffb-\\udfff]",ln="(?:"+on+"|"+sn+")",dn="[^"+bt+"]",$t="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",de="["+yt+"]",un="\\u200d",et="(?:"+kt+"|"+Pt+")",cn="(?:"+de+"|"+Pt+")",tt="(?:"+Rt+"(?:d|ll|m|re|s|t|ve))?",rt="(?:"+Rt+"(?:D|LL|M|RE|S|T|VE))?",Tt=ln+"?",Ot="["+nn+"]?",fn="(?:"+un+"(?:"+[dn,$t,Lt].join("|")+")"+Ot+Tt+")*",hn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",gn=Ot+Tt+fn,vn="(?:"+[an,$t,Lt].join("|")+")"+gn,mn=RegExp([de+"?"+kt+"+"+tt+"(?="+[Je,de,"$"].join("|")+")",cn+"+"+rt+"(?="+[Je,de+et,"$"].join("|")+")",de+"?"+et+"+"+tt,de+"+"+rt,pn,hn,St,vn].join("|"),"g");function bn(e){return e.match(mn)||[]}function wn(e,i,t){return e=lt(e),i=t?void 0:i,i===void 0?qr(e)?bn(e):Gr(e):e.match(i)||[]}var xn="['’]",yn=RegExp(xn,"g");function Cn(e){return function(i){return zr(wn(Wr(i).replace(yn,"")),e,"")}}var Rn=Cn(function(e,i,t){return e+(t?"-":"")+i.toLowerCase()});const Sn=Rn,kn=ee("attach",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),Pn=ee("trash",n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),n("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),$n=ee("download",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),Ln=ee("cancel",n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),Tn=ee("retry",n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},n("path",{d:"M320,146s24.36-12-64-12A160,160,0,1,0,416,294",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"}),n("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),On=ee("rotateClockwise",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),n("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),In=ee("rotateClockwise",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),n("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),zn=ee("zoomIn",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),n("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),Bn=ee("zoomOut",n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),n("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),_n=V({name:"ResizeSmall",render(){return n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},n("g",{fill:"none"},n("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),Dn=Ae&&"loading"in document.createElement("img"),Mn=(e={})=>{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}},Nn=Xt(Fe),jn=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(jn,Xe(this.$.vnode.props||{},Nn),{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!==je))||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.right<window.innerWidth?Q=-(b.width-window.innerWidth)/2:E==="horizontalRight"?Q=Math.min((b.width-window.innerWidth)/2,w-(X??0)):Q=Math.max(-((b.width-window.innerWidth)/2),w-(X??0)),b.height<=window.innerHeight?te=0:b.top>0?te=(b.height-window.innerHeight)/2:b.bottom<window.innerHeight?te=-(b.height-window.innerHeight)/2:M==="verticalBottom"?te=Math.min((b.height-window.innerHeight)/2,$-(K??0)):te=Math.max(-((b.height-window.innerHeight)/2),$-(K??0)),{offsetX:Q,offsetY:te}}function O(m){ve("mousemove",document,T),ve("mouseup",document,O);const{clientX:C,clientY:b}=m;L=!1;const M=g({mouseUpClientX:C,mouseUpClientY:b,mouseDownClientX:k,mouseDownClientY:x}),E=R(M);h=E.offsetX,S=E.offsetY,q()}const _=re(_t,null);function v(m){var C,b;if((b=(C=_==null?void 0:_.previewedImgPropsRef.value)===null||C===void 0?void 0:C.onMousedown)===null||b===void 0||b.call(C,m),m.button!==0)return;const{clientX:M,clientY:E}=m;L=!0,f=M-h,y=E-S,w=h,$=S,k=M,x=E,q(),Le("mousemove",document,T),Le("mouseup",document,O)}function N(m){var C,b;(b=(C=_==null?void 0:_.previewedImgPropsRef.value)===null||C===void 0?void 0:C.onDblclick)===null||b===void 0||b.call(C,m);const M=ge();I=I===M?1:M,q()}const D=1.5;let G=0,I=1,F=0;function j(){I=1,G=0}function H(){var m;j(),F=0,(m=e.onPrev)===null||m===void 0||m.call(e)}function Z(){var m;j(),F=0,(m=e.onNext)===null||m===void 0||m.call(e)}function Y(){F-=90,q()}function ae(){F+=90,q()}function ke(){const{value:m}=r;if(!m)return 1;const{innerWidth:C,innerHeight:b}=window,M=Math.max(1,m.naturalHeight/(b-be)),E=Math.max(1,m.naturalWidth/(C-be));return Math.max(3,M*2,E*2)}function ge(){const{value:m}=r;if(!m)return 1;const{innerWidth:C,innerHeight:b}=window,M=m.naturalHeight/(b-be),E=m.naturalWidth/(C-be);return M<1&&E<1?1:Math.max(M,E)}function Pe(){const m=ke();I<m&&(G+=1,I=Math.min(m,Math.pow(D,G)),q())}function $e(){if(I>.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:N,syncTransformOrigin:a,handleAfterLeave:()=>{j(),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}))),[[je,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,[Ne("iconColor",u)]:g,[Ne("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}}),Ni=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[Ne("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 Nt=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 jt=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 jt(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 Nt(this,void 0,void 0,function*(){return yield new Promise(i=>{if(!e.type||!jt(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 Nt(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(N=>{if(N===!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}),ji=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 N=v.target;x(N.files?Array.from(N.files).map(D=>({file:D,entry:null,source:"input"})):null,v),N.value=""}function $(v){const{"onUpdate:fileList":N,onUpdateFileList:D}=e;N&&Qe(N,v),D&&Qe(D,v),l.value=v}const k=P(()=>e.multiple||e.directory);function x(v,N){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:j,source:H})=>H==="dnd"&&(I!=null&&I.trim())?vi(j.name,j.type,I):!0),G&&(v=v.slice(0,G-h.value.length));const F=Me();Promise.all(v.map(({file:j,entry:H})=>st(this,void 0,void 0,function*(){var Z;const Y={id:Me(),batchId:F,name:j.name,status:"pending",percentage:0,file:j,url:null,type:j.type,thumbnailUrl:null,fullPath:(Z=H==null?void 0:H.fullPath)!==null&&Z!==void 0?Z:`/${j.webkitRelativePath||j.name}`};return!D||(yield D({file:Y,fileList:h.value}))!==!1?Y:null}))).then(j=>st(this,void 0,void 0,function*(){let H=Promise.resolve();j.forEach(Z=>{H=H.then(Rr).then(()=>{Z&&T(Z,N,{append:!0})})}),yield H})).then(()=>{e.defaultUpload&&L()})}function L(v){const{method:N,action:D,withCredentials:G,headers:I,data:F,name:j}=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},j,Y,{method:N,action:D,withCredentials:G,responseType:e.responseType,headers:I,data:F}))})}const T=(v,N,D={append:!1,remove:!1})=>{const{append:G,remove:I}=D,F=Array.from(h.value),j=F.findIndex(H=>H.id===v.id);if(G||I||~j){G?F.push(v):I?F.splice(j,1):F.splice(j,1,v);const{onChange:H}=e;H&&H({file:v,fileList:F,event:N}),$(F)}};function g(v){var N;if(v.thumbnailUrl)return v.thumbnailUrl;const{createThumbnailUrl:D}=e;return D?(N=D(v.file,v))!==null&&N!==void 0?N:v.url||"":v.url?v.url:v.file?ci(v.file):""}const R=P(()=>{const{common:{cubicBezierEaseInOut:v},self:{draggerColor:N,draggerBorder:D,draggerBorderHover:G,itemColorHover:I,itemColorHoverError:F,itemTextColorError:j,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":N,"--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":j,"--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{ji as _,ai as a,Ni as b,Qn as c,Mi as d,Ei as e,Ui as g,Ai as p};
|