index6.js 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577
  1. import { x as rt, y as it, z as lt, A as B, C as I, D as W, E as Se, e as q, F as Z, d as J, G as Ce, _ as P, a as D, b as ne, H as ke, g as Me, I as Ne, J as We, M as xe, j as fe, N as st, O as at, Q as ct, S as ut, h as dt, w as pt, T as de, U as ft, V as gt, W as mt, X as vt, Y as ht, Z as yt, $ as bt, a0 as wt, a1 as $t, n as Oe, a2 as Ct, i as St, B as De, a3 as Be, t as Xe, a4 as xt, a5 as It, l as Pt, a6 as Ot, a7 as Dt, m as re, a8 as Ft } from "./index2.js";
  2. import { ref as Q, onBeforeUpdate as Rt, defineComponent as z, computed as _, createVNode as d, Fragment as ze, onUpdated as _t, onMounted as ge, onBeforeUnmount as He, shallowRef as le, watch as Ge, Transition as At, withDirectives as qe, vShow as Ve, watchEffect as Tt, triggerRef as Et, TransitionGroup as Lt, toRef as jt } from "vue";
  3. import { p as Ut } from "./pickAttrs.js";
  4. import { b as kt } from "./index5.js";
  5. import { u as Mt } from "./useMergedState.js";
  6. import { u as Nt } from "./FormItemContext.js";
  7. function Wt(e, t, o, n) {
  8. for (var r = -1, l = e == null ? 0 : e.length; ++r < l; ) {
  9. var i = e[r];
  10. t(n, i, o(i), e);
  11. }
  12. return n;
  13. }
  14. function Bt(e) {
  15. return function(t, o, n) {
  16. for (var r = -1, l = Object(t), i = n(t), a = i.length; a--; ) {
  17. var c = i[++r];
  18. if (o(l[c], c, l) === !1)
  19. break;
  20. }
  21. return t;
  22. };
  23. }
  24. var Xt = Bt();
  25. function zt(e, t) {
  26. return e && Xt(e, t, rt);
  27. }
  28. function Ht(e, t) {
  29. return function(o, n) {
  30. if (o == null)
  31. return o;
  32. if (!it(o))
  33. return e(o, n);
  34. for (var r = o.length, l = -1, i = Object(o); ++l < r && n(i[l], l, i) !== !1; )
  35. ;
  36. return o;
  37. };
  38. }
  39. var Gt = Ht(zt);
  40. function qt(e, t, o, n) {
  41. return Gt(e, function(r, l, i) {
  42. t(n, r, o(r), i);
  43. }), n;
  44. }
  45. function Vt(e, t) {
  46. return function(o, n) {
  47. var r = lt(o) ? Wt : qt, l = t ? t() : {};
  48. return r(o, e, kt(n), l);
  49. };
  50. }
  51. var Kt = Vt(function(e, t, o) {
  52. e[o ? 0 : 1].push(t);
  53. }, function() {
  54. return [[], []];
  55. });
  56. const Yt = () => {
  57. const e = Q(/* @__PURE__ */ new Map()), t = (o) => (n) => {
  58. e.value.set(o, n);
  59. };
  60. return Rt(() => {
  61. e.value = /* @__PURE__ */ new Map();
  62. }), [t, e];
  63. }, Jt = ["normal", "exception", "active", "success"], me = () => ({
  64. prefixCls: String,
  65. type: B(),
  66. percent: Number,
  67. format: I(),
  68. status: B(),
  69. showInfo: W(),
  70. strokeWidth: Number,
  71. strokeLinecap: B(),
  72. strokeColor: Se(),
  73. trailColor: String,
  74. /** @deprecated Use `size` instead */
  75. width: Number,
  76. success: q(),
  77. gapDegree: Number,
  78. gapPosition: B(),
  79. size: Z([String, Number, Array]),
  80. steps: Number,
  81. /** @deprecated Use `success` instead */
  82. successPercent: Number,
  83. title: String,
  84. progressStatus: B()
  85. });
  86. function ee(e) {
  87. return !e || e < 0 ? 0 : e > 100 ? 100 : e;
  88. }
  89. function pe(e) {
  90. let {
  91. success: t,
  92. successPercent: o
  93. } = e, n = o;
  94. return t && "progress" in t && (J(!1, "Progress", "`success.progress` is deprecated. Please use `success.percent` instead."), n = t.progress), t && "percent" in t && (n = t.percent), n;
  95. }
  96. function Qt(e) {
  97. let {
  98. percent: t,
  99. success: o,
  100. successPercent: n
  101. } = e;
  102. const r = ee(pe({
  103. success: o,
  104. successPercent: n
  105. }));
  106. return [r, ee(ee(t) - r)];
  107. }
  108. function Zt(e) {
  109. let {
  110. success: t = {},
  111. strokeColor: o
  112. } = e;
  113. const {
  114. strokeColor: n
  115. } = t;
  116. return [n || Ce.green, o || null];
  117. }
  118. const ve = (e, t, o) => {
  119. var n, r, l, i;
  120. let a = -1, c = -1;
  121. if (t === "step") {
  122. const b = o.steps, u = o.strokeWidth;
  123. typeof e == "string" || typeof e == "undefined" ? (a = e === "small" ? 2 : 14, c = u != null ? u : 8) : typeof e == "number" ? [a, c] = [e, e] : [a = 14, c = 8] = e, a *= b;
  124. } else if (t === "line") {
  125. const b = o == null ? void 0 : o.strokeWidth;
  126. typeof e == "string" || typeof e == "undefined" ? c = b || (e === "small" ? 6 : 8) : typeof e == "number" ? [a, c] = [e, e] : [a = -1, c = 8] = e;
  127. } else (t === "circle" || t === "dashboard") && (typeof e == "string" || typeof e == "undefined" ? [a, c] = e === "small" ? [60, 60] : [120, 120] : typeof e == "number" ? [a, c] = [e, e] : (process.env.NODE_ENV !== "production" && J(!1, "Progress", 'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.'), a = (r = (n = e[0]) !== null && n !== void 0 ? n : e[1]) !== null && r !== void 0 ? r : 120, c = (i = (l = e[0]) !== null && l !== void 0 ? l : e[1]) !== null && i !== void 0 ? i : 120));
  128. return {
  129. width: a,
  130. height: c
  131. };
  132. };
  133. var en = function(e, t) {
  134. var o = {};
  135. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  136. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  137. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  138. return o;
  139. };
  140. const tn = () => P(P({}, me()), {
  141. strokeColor: Se(),
  142. direction: B()
  143. }), nn = (e) => {
  144. let t = [];
  145. return Object.keys(e).forEach((o) => {
  146. const n = parseFloat(o.replace(/%/g, ""));
  147. isNaN(n) || t.push({
  148. key: n,
  149. value: e[o]
  150. });
  151. }), t = t.sort((o, n) => o.key - n.key), t.map((o) => {
  152. let {
  153. key: n,
  154. value: r
  155. } = o;
  156. return `${r} ${n}%`;
  157. }).join(", ");
  158. }, on = (e, t) => {
  159. const {
  160. from: o = Ce.blue,
  161. to: n = Ce.blue,
  162. direction: r = t === "rtl" ? "to left" : "to right"
  163. } = e, l = en(e, ["from", "to", "direction"]);
  164. if (Object.keys(l).length !== 0) {
  165. const i = nn(l);
  166. return {
  167. backgroundImage: `linear-gradient(${r}, ${i})`
  168. };
  169. }
  170. return {
  171. backgroundImage: `linear-gradient(${r}, ${o}, ${n})`
  172. };
  173. }, rn = z({
  174. compatConfig: {
  175. MODE: 3
  176. },
  177. name: "ProgressLine",
  178. inheritAttrs: !1,
  179. props: tn(),
  180. setup(e, t) {
  181. let {
  182. slots: o,
  183. attrs: n
  184. } = t;
  185. const r = _(() => {
  186. const {
  187. strokeColor: g,
  188. direction: F
  189. } = e;
  190. return g && typeof g != "string" ? on(g, F) : {
  191. backgroundColor: g
  192. };
  193. }), l = _(() => e.strokeLinecap === "square" || e.strokeLinecap === "butt" ? 0 : void 0), i = _(() => e.trailColor ? {
  194. backgroundColor: e.trailColor
  195. } : void 0), a = _(() => {
  196. var g;
  197. return (g = e.size) !== null && g !== void 0 ? g : [-1, e.strokeWidth || (e.size === "small" ? 6 : 8)];
  198. }), c = _(() => ve(a.value, "line", {
  199. strokeWidth: e.strokeWidth
  200. }));
  201. process.env.NODE_ENV !== "production" && J("strokeWidth" in e, "Progress", "`strokeWidth` is deprecated. Please use `size` instead.");
  202. const b = _(() => {
  203. const {
  204. percent: g
  205. } = e;
  206. return P({
  207. width: `${ee(g)}%`,
  208. height: `${c.value.height}px`,
  209. borderRadius: l.value
  210. }, r.value);
  211. }), u = _(() => pe(e)), O = _(() => {
  212. const {
  213. success: g
  214. } = e;
  215. return {
  216. width: `${ee(u.value)}%`,
  217. height: `${c.value.height}px`,
  218. borderRadius: l.value,
  219. backgroundColor: g == null ? void 0 : g.strokeColor
  220. };
  221. }), y = {
  222. width: c.value.width < 0 ? "100%" : c.value.width,
  223. height: `${c.value.height}px`
  224. };
  225. return () => {
  226. var g;
  227. return d(ze, null, [d("div", D(D({}, n), {}, {
  228. class: [`${e.prefixCls}-outer`, n.class],
  229. style: [n.style, y]
  230. }), [d("div", {
  231. class: `${e.prefixCls}-inner`,
  232. style: i.value
  233. }, [d("div", {
  234. class: `${e.prefixCls}-bg`,
  235. style: b.value
  236. }, null), u.value !== void 0 ? d("div", {
  237. class: `${e.prefixCls}-success-bg`,
  238. style: O.value
  239. }, null) : null])]), (g = o.default) === null || g === void 0 ? void 0 : g.call(o)]);
  240. };
  241. }
  242. }), ln = {
  243. percent: 0,
  244. prefixCls: "vc-progress",
  245. strokeColor: "#2db7f5",
  246. strokeLinecap: "round",
  247. strokeWidth: 1,
  248. trailColor: "#D9D9D9",
  249. trailWidth: 1
  250. }, sn = (e) => {
  251. const t = Q(null);
  252. return _t(() => {
  253. const o = Date.now();
  254. let n = !1;
  255. e.value.forEach((r) => {
  256. const l = (r == null ? void 0 : r.$el) || r;
  257. if (!l)
  258. return;
  259. n = !0;
  260. const i = l.style;
  261. i.transitionDuration = ".3s, .3s, .3s, .06s", t.value && o - t.value < 100 && (i.transitionDuration = "0s, 0s");
  262. }), n && (t.value = Date.now());
  263. }), e;
  264. }, an = {
  265. gapDegree: Number,
  266. gapPosition: {
  267. type: String
  268. },
  269. percent: {
  270. type: [Array, Number]
  271. },
  272. prefixCls: String,
  273. strokeColor: {
  274. type: [Object, String, Array]
  275. },
  276. strokeLinecap: {
  277. type: String
  278. },
  279. strokeWidth: Number,
  280. trailColor: String,
  281. trailWidth: Number,
  282. transition: String
  283. };
  284. var cn = function(e, t) {
  285. var o = {};
  286. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  287. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  288. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  289. return o;
  290. };
  291. let Fe = 0;
  292. function Re(e) {
  293. return +e.replace("%", "");
  294. }
  295. function _e(e) {
  296. return Array.isArray(e) ? e : [e];
  297. }
  298. function Ae(e, t, o, n) {
  299. let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, l = arguments.length > 5 ? arguments[5] : void 0;
  300. const i = 50 - n / 2;
  301. let a = 0, c = -i, b = 0, u = -2 * i;
  302. switch (l) {
  303. case "left":
  304. a = -i, c = 0, b = 2 * i, u = 0;
  305. break;
  306. case "right":
  307. a = i, c = 0, b = -2 * i, u = 0;
  308. break;
  309. case "bottom":
  310. c = i, u = 2 * i;
  311. break;
  312. }
  313. const O = `M 50,50 m ${a},${c}
  314. a ${i},${i} 0 1 1 ${b},${-u}
  315. a ${i},${i} 0 1 1 ${-b},${u}`, y = Math.PI * 2 * i, g = {
  316. stroke: o,
  317. strokeDasharray: `${t / 100 * (y - r)}px ${y}px`,
  318. strokeDashoffset: `-${r / 2 + e / 100 * (y - r)}px`,
  319. transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"
  320. // eslint-disable-line
  321. };
  322. return {
  323. pathString: O,
  324. pathStyle: g
  325. };
  326. }
  327. const un = z({
  328. compatConfig: {
  329. MODE: 3
  330. },
  331. name: "VCCircle",
  332. props: ne(an, ln),
  333. setup(e) {
  334. Fe += 1;
  335. const t = Q(Fe), o = _(() => _e(e.percent)), n = _(() => _e(e.strokeColor)), [r, l] = Yt();
  336. sn(l);
  337. const i = () => {
  338. const {
  339. prefixCls: a,
  340. strokeWidth: c,
  341. strokeLinecap: b,
  342. gapDegree: u,
  343. gapPosition: O
  344. } = e;
  345. let y = 0;
  346. return o.value.map((g, F) => {
  347. const s = n.value[F] || n.value[n.value.length - 1], v = Object.prototype.toString.call(s) === "[object Object]" ? `url(#${a}-gradient-${t.value})` : "", {
  348. pathString: R,
  349. pathStyle: p
  350. } = Ae(y, g, s, c, u, O);
  351. y += g;
  352. const h = {
  353. key: F,
  354. d: R,
  355. stroke: v,
  356. "stroke-linecap": b,
  357. "stroke-width": c,
  358. opacity: g === 0 ? 0 : 1,
  359. "fill-opacity": "0",
  360. class: `${a}-circle-path`,
  361. style: p
  362. };
  363. return d("path", D({
  364. ref: r(F)
  365. }, h), null);
  366. });
  367. };
  368. return () => {
  369. const {
  370. prefixCls: a,
  371. strokeWidth: c,
  372. trailWidth: b,
  373. gapDegree: u,
  374. gapPosition: O,
  375. trailColor: y,
  376. strokeLinecap: g,
  377. strokeColor: F
  378. } = e, s = cn(e, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "strokeColor"]), {
  379. pathString: v,
  380. pathStyle: R
  381. } = Ae(0, 100, y, c, u, O);
  382. delete s.percent;
  383. const p = n.value.find((m) => Object.prototype.toString.call(m) === "[object Object]"), h = {
  384. d: v,
  385. stroke: y,
  386. "stroke-linecap": g,
  387. "stroke-width": b || c,
  388. "fill-opacity": "0",
  389. class: `${a}-circle-trail`,
  390. style: R
  391. };
  392. return d("svg", D({
  393. class: `${a}-circle`,
  394. viewBox: "0 0 100 100"
  395. }, s), [p && d("defs", null, [d("linearGradient", {
  396. id: `${a}-gradient-${t.value}`,
  397. x1: "100%",
  398. y1: "0%",
  399. x2: "0%",
  400. y2: "0%"
  401. }, [Object.keys(p).sort((m, S) => Re(m) - Re(S)).map((m, S) => d("stop", {
  402. key: S,
  403. offset: m,
  404. "stop-color": p[m]
  405. }, null))])]), d("path", h, null), i().reverse()]);
  406. };
  407. }
  408. }), dn = () => P(P({}, me()), {
  409. strokeColor: Se()
  410. }), pn = 3, fn = (e) => pn / e * 100, gn = z({
  411. compatConfig: {
  412. MODE: 3
  413. },
  414. name: "ProgressCircle",
  415. inheritAttrs: !1,
  416. props: ne(dn(), {
  417. trailColor: null
  418. }),
  419. setup(e, t) {
  420. let {
  421. slots: o,
  422. attrs: n
  423. } = t;
  424. const r = _(() => {
  425. var s;
  426. return (s = e.width) !== null && s !== void 0 ? s : 120;
  427. }), l = _(() => {
  428. var s;
  429. return (s = e.size) !== null && s !== void 0 ? s : [r.value, r.value];
  430. }), i = _(() => ve(l.value, "circle")), a = _(() => {
  431. if (e.gapDegree || e.gapDegree === 0)
  432. return e.gapDegree;
  433. if (e.type === "dashboard")
  434. return 75;
  435. }), c = _(() => ({
  436. width: `${i.value.width}px`,
  437. height: `${i.value.height}px`,
  438. fontSize: `${i.value.width * 0.15 + 6}px`
  439. })), b = _(() => {
  440. var s;
  441. return (s = e.strokeWidth) !== null && s !== void 0 ? s : Math.max(fn(i.value.width), 6);
  442. }), u = _(() => e.gapPosition || e.type === "dashboard" && "bottom" || void 0), O = _(() => Qt(e)), y = _(() => Object.prototype.toString.call(e.strokeColor) === "[object Object]"), g = _(() => Zt({
  443. success: e.success,
  444. strokeColor: e.strokeColor
  445. })), F = _(() => ({
  446. [`${e.prefixCls}-inner`]: !0,
  447. [`${e.prefixCls}-circle-gradient`]: y.value
  448. }));
  449. return () => {
  450. var s;
  451. const v = d(un, {
  452. percent: O.value,
  453. strokeWidth: b.value,
  454. trailWidth: b.value,
  455. strokeColor: g.value,
  456. strokeLinecap: e.strokeLinecap,
  457. trailColor: e.trailColor,
  458. prefixCls: e.prefixCls,
  459. gapDegree: a.value,
  460. gapPosition: u.value
  461. }, null);
  462. return d("div", D(D({}, n), {}, {
  463. class: [F.value, n.class],
  464. style: [n.style, c.value]
  465. }), [i.value.width <= 20 ? d(ke, null, {
  466. default: () => [d("span", null, [v])],
  467. title: o.default
  468. }) : d(ze, null, [v, (s = o.default) === null || s === void 0 ? void 0 : s.call(o)])]);
  469. };
  470. }
  471. }), mn = () => P(P({}, me()), {
  472. steps: Number,
  473. strokeColor: Z(),
  474. trailColor: String
  475. }), vn = z({
  476. compatConfig: {
  477. MODE: 3
  478. },
  479. name: "Steps",
  480. props: mn(),
  481. setup(e, t) {
  482. let {
  483. slots: o
  484. } = t;
  485. const n = _(() => Math.round(e.steps * ((e.percent || 0) / 100))), r = _(() => {
  486. var a;
  487. return (a = e.size) !== null && a !== void 0 ? a : [e.size === "small" ? 2 : 14, e.strokeWidth || 8];
  488. }), l = _(() => ve(r.value, "step", {
  489. steps: e.steps,
  490. strokeWidth: e.strokeWidth || 8
  491. })), i = _(() => {
  492. const {
  493. steps: a,
  494. strokeColor: c,
  495. trailColor: b,
  496. prefixCls: u
  497. } = e, O = [];
  498. for (let y = 0; y < a; y += 1) {
  499. const g = Array.isArray(c) ? c[y] : c, F = {
  500. [`${u}-steps-item`]: !0,
  501. [`${u}-steps-item-active`]: y <= n.value - 1
  502. };
  503. O.push(d("div", {
  504. key: y,
  505. class: F,
  506. style: {
  507. backgroundColor: y <= n.value - 1 ? g : b,
  508. width: `${l.value.width / a}px`,
  509. height: `${l.value.height}px`
  510. }
  511. }, null));
  512. }
  513. return O;
  514. });
  515. return () => {
  516. var a;
  517. return d("div", {
  518. class: `${e.prefixCls}-steps-outer`
  519. }, [i.value, (a = o.default) === null || a === void 0 ? void 0 : a.call(o)]);
  520. };
  521. }
  522. }), hn = new xe("antProgressActive", {
  523. "0%": {
  524. transform: "translateX(-100%) scaleX(0)",
  525. opacity: 0.1
  526. },
  527. "20%": {
  528. transform: "translateX(-100%) scaleX(0)",
  529. opacity: 0.5
  530. },
  531. to: {
  532. transform: "translateX(0) scaleX(1)",
  533. opacity: 0
  534. }
  535. }), yn = (e) => {
  536. const {
  537. componentCls: t,
  538. iconCls: o
  539. } = e;
  540. return {
  541. [t]: P(P({}, We(e)), {
  542. display: "inline-block",
  543. "&-rtl": {
  544. direction: "rtl"
  545. },
  546. "&-line": {
  547. position: "relative",
  548. width: "100%",
  549. fontSize: e.fontSize,
  550. marginInlineEnd: e.marginXS,
  551. marginBottom: e.marginXS
  552. },
  553. [`${t}-outer`]: {
  554. display: "inline-block",
  555. width: "100%"
  556. },
  557. [`&${t}-show-info`]: {
  558. [`${t}-outer`]: {
  559. marginInlineEnd: `calc(-2em - ${e.marginXS}px)`,
  560. paddingInlineEnd: `calc(2em + ${e.paddingXS}px)`
  561. }
  562. },
  563. [`${t}-inner`]: {
  564. position: "relative",
  565. display: "inline-block",
  566. width: "100%",
  567. overflow: "hidden",
  568. verticalAlign: "middle",
  569. backgroundColor: e.progressRemainingColor,
  570. borderRadius: e.progressLineRadius
  571. },
  572. [`${t}-inner:not(${t}-circle-gradient)`]: {
  573. [`${t}-circle-path`]: {
  574. stroke: e.colorInfo
  575. }
  576. },
  577. [`${t}-success-bg, ${t}-bg`]: {
  578. position: "relative",
  579. backgroundColor: e.colorInfo,
  580. borderRadius: e.progressLineRadius,
  581. transition: `all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`
  582. },
  583. [`${t}-success-bg`]: {
  584. position: "absolute",
  585. insetBlockStart: 0,
  586. insetInlineStart: 0,
  587. backgroundColor: e.colorSuccess
  588. },
  589. [`${t}-text`]: {
  590. display: "inline-block",
  591. width: "2em",
  592. marginInlineStart: e.marginXS,
  593. color: e.progressInfoTextColor,
  594. lineHeight: 1,
  595. whiteSpace: "nowrap",
  596. textAlign: "start",
  597. verticalAlign: "middle",
  598. wordBreak: "normal",
  599. [o]: {
  600. fontSize: e.fontSize
  601. }
  602. },
  603. [`&${t}-status-active`]: {
  604. [`${t}-bg::before`]: {
  605. position: "absolute",
  606. inset: 0,
  607. backgroundColor: e.colorBgContainer,
  608. borderRadius: e.progressLineRadius,
  609. opacity: 0,
  610. animationName: hn,
  611. animationDuration: e.progressActiveMotionDuration,
  612. animationTimingFunction: e.motionEaseOutQuint,
  613. animationIterationCount: "infinite",
  614. content: '""'
  615. }
  616. },
  617. [`&${t}-status-exception`]: {
  618. [`${t}-bg`]: {
  619. backgroundColor: e.colorError
  620. },
  621. [`${t}-text`]: {
  622. color: e.colorError
  623. }
  624. },
  625. [`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]: {
  626. [`${t}-circle-path`]: {
  627. stroke: e.colorError
  628. }
  629. },
  630. [`&${t}-status-success`]: {
  631. [`${t}-bg`]: {
  632. backgroundColor: e.colorSuccess
  633. },
  634. [`${t}-text`]: {
  635. color: e.colorSuccess
  636. }
  637. },
  638. [`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]: {
  639. [`${t}-circle-path`]: {
  640. stroke: e.colorSuccess
  641. }
  642. }
  643. })
  644. };
  645. }, bn = (e) => {
  646. const {
  647. componentCls: t,
  648. iconCls: o
  649. } = e;
  650. return {
  651. [t]: {
  652. [`${t}-circle-trail`]: {
  653. stroke: e.progressRemainingColor
  654. },
  655. [`&${t}-circle ${t}-inner`]: {
  656. position: "relative",
  657. lineHeight: 1,
  658. backgroundColor: "transparent"
  659. },
  660. [`&${t}-circle ${t}-text`]: {
  661. position: "absolute",
  662. insetBlockStart: "50%",
  663. insetInlineStart: 0,
  664. width: "100%",
  665. margin: 0,
  666. padding: 0,
  667. color: e.colorText,
  668. lineHeight: 1,
  669. whiteSpace: "normal",
  670. textAlign: "center",
  671. transform: "translateY(-50%)",
  672. [o]: {
  673. fontSize: `${e.fontSize / e.fontSizeSM}em`
  674. }
  675. },
  676. [`${t}-circle&-status-exception`]: {
  677. [`${t}-text`]: {
  678. color: e.colorError
  679. }
  680. },
  681. [`${t}-circle&-status-success`]: {
  682. [`${t}-text`]: {
  683. color: e.colorSuccess
  684. }
  685. }
  686. },
  687. [`${t}-inline-circle`]: {
  688. lineHeight: 1,
  689. [`${t}-inner`]: {
  690. verticalAlign: "bottom"
  691. }
  692. }
  693. };
  694. }, wn = (e) => {
  695. const {
  696. componentCls: t
  697. } = e;
  698. return {
  699. [t]: {
  700. [`${t}-steps`]: {
  701. display: "inline-block",
  702. "&-outer": {
  703. display: "flex",
  704. flexDirection: "row",
  705. alignItems: "center"
  706. },
  707. "&-item": {
  708. flexShrink: 0,
  709. minWidth: e.progressStepMinWidth,
  710. marginInlineEnd: e.progressStepMarginInlineEnd,
  711. backgroundColor: e.progressRemainingColor,
  712. transition: `all ${e.motionDurationSlow}`,
  713. "&-active": {
  714. backgroundColor: e.colorInfo
  715. }
  716. }
  717. }
  718. }
  719. };
  720. }, $n = (e) => {
  721. const {
  722. componentCls: t,
  723. iconCls: o
  724. } = e;
  725. return {
  726. [t]: {
  727. [`${t}-small&-line, ${t}-small&-line ${t}-text ${o}`]: {
  728. fontSize: e.fontSizeSM
  729. }
  730. }
  731. };
  732. }, Cn = Me("Progress", (e) => {
  733. const t = e.marginXXS / 2, o = Ne(e, {
  734. progressLineRadius: 100,
  735. progressInfoTextColor: e.colorText,
  736. progressDefaultColor: e.colorInfo,
  737. progressRemainingColor: e.colorFillSecondary,
  738. progressStepMarginInlineEnd: t,
  739. progressStepMinWidth: t,
  740. progressActiveMotionDuration: "2.4s"
  741. });
  742. return [yn(o), bn(o), wn(o), $n(o)];
  743. });
  744. var Sn = function(e, t) {
  745. var o = {};
  746. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  747. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  748. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  749. return o;
  750. };
  751. const xn = z({
  752. compatConfig: {
  753. MODE: 3
  754. },
  755. name: "AProgress",
  756. inheritAttrs: !1,
  757. props: ne(me(), {
  758. type: "line",
  759. percent: 0,
  760. showInfo: !0,
  761. // null for different theme definition
  762. trailColor: null,
  763. size: "default",
  764. strokeLinecap: "round"
  765. }),
  766. slots: Object,
  767. setup(e, t) {
  768. let {
  769. slots: o,
  770. attrs: n
  771. } = t;
  772. const {
  773. prefixCls: r,
  774. direction: l
  775. } = fe("progress", e), [i, a] = Cn(r);
  776. process.env.NODE_ENV !== "production" && (J("successPercent" in e, "Progress", "`successPercent` is deprecated. Please use `success.percent` instead."), J("width" in e, "Progress", "`width` is deprecated. Please use `size` instead."));
  777. const c = _(() => Array.isArray(e.strokeColor) ? e.strokeColor[0] : e.strokeColor), b = _(() => {
  778. const {
  779. percent: F = 0
  780. } = e, s = pe(e);
  781. return parseInt(s !== void 0 ? s.toString() : F.toString(), 10);
  782. }), u = _(() => {
  783. const {
  784. status: F
  785. } = e;
  786. return !Jt.includes(F) && b.value >= 100 ? "success" : F || "normal";
  787. }), O = _(() => {
  788. const {
  789. type: F,
  790. showInfo: s,
  791. size: v
  792. } = e, R = r.value;
  793. return {
  794. [R]: !0,
  795. [`${R}-inline-circle`]: F === "circle" && ve(v, "circle").width <= 20,
  796. [`${R}-${F === "dashboard" && "circle" || F}`]: !0,
  797. [`${R}-status-${u.value}`]: !0,
  798. [`${R}-show-info`]: s,
  799. [`${R}-${v}`]: v,
  800. [`${R}-rtl`]: l.value === "rtl",
  801. [a.value]: !0
  802. };
  803. }), y = _(() => typeof e.strokeColor == "string" || Array.isArray(e.strokeColor) ? e.strokeColor : void 0), g = () => {
  804. const {
  805. showInfo: F,
  806. format: s,
  807. type: v,
  808. percent: R,
  809. title: p
  810. } = e, h = pe(e);
  811. if (!F) return null;
  812. let m;
  813. const S = s || (o == null ? void 0 : o.format) || ((L) => `${L}%`), E = v === "line";
  814. return s || o != null && o.format || u.value !== "exception" && u.value !== "success" ? m = S(ee(R), ee(h)) : u.value === "exception" ? m = E ? d(st, null, null) : d(at, null, null) : u.value === "success" && (m = E ? d(ct, null, null) : d(ut, null, null)), d("span", {
  815. class: `${r.value}-text`,
  816. title: p === void 0 && typeof m == "string" ? m : void 0
  817. }, [m]);
  818. };
  819. return () => {
  820. const {
  821. type: F,
  822. steps: s,
  823. title: v
  824. } = e, {
  825. class: R
  826. } = n, p = Sn(n, ["class"]), h = g();
  827. let m;
  828. return F === "line" ? m = s ? d(vn, D(D({}, e), {}, {
  829. strokeColor: y.value,
  830. prefixCls: r.value,
  831. steps: s
  832. }), {
  833. default: () => [h]
  834. }) : d(rn, D(D({}, e), {}, {
  835. strokeColor: c.value,
  836. prefixCls: r.value,
  837. direction: l.value
  838. }), {
  839. default: () => [h]
  840. }) : (F === "circle" || F === "dashboard") && (m = d(gn, D(D({}, e), {}, {
  841. prefixCls: r.value,
  842. strokeColor: c.value,
  843. progressStatus: u.value
  844. }), {
  845. default: () => [h]
  846. })), i(d("div", D(D({
  847. role: "progressbar"
  848. }, p), {}, {
  849. class: [O.value, R],
  850. title: v
  851. }), [m]));
  852. };
  853. }
  854. }), In = dt(xn);
  855. function Pn(e, t) {
  856. const o = `cannot ${e.method} ${e.action} ${t.status}'`, n = new Error(o);
  857. return n.status = t.status, n.method = e.method, n.url = e.action, n;
  858. }
  859. function Te(e) {
  860. const t = e.responseText || e.response;
  861. if (!t)
  862. return t;
  863. try {
  864. return JSON.parse(t);
  865. } catch (o) {
  866. return t;
  867. }
  868. }
  869. function On(e) {
  870. const t = new XMLHttpRequest();
  871. e.onProgress && t.upload && (t.upload.onprogress = function(l) {
  872. l.total > 0 && (l.percent = l.loaded / l.total * 100), e.onProgress(l);
  873. });
  874. const o = new FormData();
  875. e.data && Object.keys(e.data).forEach((r) => {
  876. const l = e.data[r];
  877. if (Array.isArray(l)) {
  878. l.forEach((i) => {
  879. o.append(`${r}[]`, i);
  880. });
  881. return;
  882. }
  883. o.append(r, l);
  884. }), e.file instanceof Blob ? o.append(e.filename, e.file, e.file.name) : o.append(e.filename, e.file), t.onerror = function(l) {
  885. e.onError(l);
  886. }, t.onload = function() {
  887. return t.status < 200 || t.status >= 300 ? e.onError(Pn(e, t), Te(t)) : e.onSuccess(Te(t), t);
  888. }, t.open(e.method, e.action, !0), e.withCredentials && "withCredentials" in t && (t.withCredentials = !0);
  889. const n = e.headers || {};
  890. return n["X-Requested-With"] !== null && t.setRequestHeader("X-Requested-With", "XMLHttpRequest"), Object.keys(n).forEach((r) => {
  891. n[r] !== null && t.setRequestHeader(r, n[r]);
  892. }), t.send(o), {
  893. abort() {
  894. t.abort();
  895. }
  896. };
  897. }
  898. const Dn = +/* @__PURE__ */ new Date();
  899. let Fn = 0;
  900. function ye() {
  901. return `vc-upload-${Dn}-${++Fn}`;
  902. }
  903. const be = (e, t) => {
  904. if (e && t) {
  905. const o = Array.isArray(t) ? t : t.split(","), n = e.name || "", r = e.type || "", l = r.replace(/\/.*$/, "");
  906. return o.some((i) => {
  907. const a = i.trim();
  908. if (/^\*(\/\*)?$/.test(i))
  909. return !0;
  910. if (a.charAt(0) === ".") {
  911. const c = n.toLowerCase(), b = a.toLowerCase();
  912. let u = [b];
  913. return (b === ".jpg" || b === ".jpeg") && (u = [".jpg", ".jpeg"]), u.some((O) => c.endsWith(O));
  914. }
  915. return /\/\*$/.test(a) ? l === a.replace(/\/.*$/, "") : r === a ? !0 : /^\w+$/.test(a) ? (pt(!1, `Upload takes an invalidate 'accept' type '${a}'.Skip for check.`), !0) : !1;
  916. });
  917. }
  918. return !0;
  919. };
  920. function Rn(e, t) {
  921. const o = e.createReader();
  922. let n = [];
  923. function r() {
  924. o.readEntries((l) => {
  925. const i = Array.prototype.slice.apply(l);
  926. n = n.concat(i), !i.length ? t(n) : r();
  927. });
  928. }
  929. r();
  930. }
  931. const _n = (e, t, o) => {
  932. const n = (r, l) => {
  933. r.path = l || "", r.isFile ? r.file((i) => {
  934. o(i) && (r.fullPath && !i.webkitRelativePath && (Object.defineProperties(i, {
  935. webkitRelativePath: {
  936. writable: !0
  937. }
  938. }), i.webkitRelativePath = r.fullPath.replace(/^\//, ""), Object.defineProperties(i, {
  939. webkitRelativePath: {
  940. writable: !1
  941. }
  942. })), t([i]));
  943. }) : r.isDirectory && Rn(r, (i) => {
  944. i.forEach((a) => {
  945. n(a, `${l}${r.name}/`);
  946. });
  947. });
  948. };
  949. e.forEach((r) => {
  950. n(r.webkitGetAsEntry());
  951. });
  952. }, Ke = () => ({
  953. capture: [Boolean, String],
  954. multipart: {
  955. type: Boolean,
  956. default: void 0
  957. },
  958. name: String,
  959. disabled: {
  960. type: Boolean,
  961. default: void 0
  962. },
  963. componentTag: String,
  964. action: [String, Function],
  965. method: String,
  966. directory: {
  967. type: Boolean,
  968. default: void 0
  969. },
  970. data: [Object, Function],
  971. headers: Object,
  972. accept: String,
  973. multiple: {
  974. type: Boolean,
  975. default: void 0
  976. },
  977. onBatchStart: Function,
  978. onReject: Function,
  979. onStart: Function,
  980. onError: Function,
  981. onSuccess: Function,
  982. onProgress: Function,
  983. beforeUpload: Function,
  984. customRequest: Function,
  985. withCredentials: {
  986. type: Boolean,
  987. default: void 0
  988. },
  989. openFileDialogOnClick: {
  990. type: Boolean,
  991. default: void 0
  992. },
  993. prefixCls: String,
  994. id: String,
  995. onMouseenter: Function,
  996. onMouseleave: Function,
  997. onClick: Function
  998. });
  999. var An = function(e, t, o, n) {
  1000. function r(l) {
  1001. return l instanceof o ? l : new o(function(i) {
  1002. i(l);
  1003. });
  1004. }
  1005. return new (o || (o = Promise))(function(l, i) {
  1006. function a(u) {
  1007. try {
  1008. b(n.next(u));
  1009. } catch (O) {
  1010. i(O);
  1011. }
  1012. }
  1013. function c(u) {
  1014. try {
  1015. b(n.throw(u));
  1016. } catch (O) {
  1017. i(O);
  1018. }
  1019. }
  1020. function b(u) {
  1021. u.done ? l(u.value) : r(u.value).then(a, c);
  1022. }
  1023. b((n = n.apply(e, t || [])).next());
  1024. });
  1025. }, Tn = function(e, t) {
  1026. var o = {};
  1027. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  1028. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  1029. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  1030. return o;
  1031. };
  1032. const En = z({
  1033. compatConfig: {
  1034. MODE: 3
  1035. },
  1036. name: "AjaxUploader",
  1037. inheritAttrs: !1,
  1038. props: Ke(),
  1039. setup(e, t) {
  1040. let {
  1041. slots: o,
  1042. attrs: n,
  1043. expose: r
  1044. } = t;
  1045. const l = Q(ye()), i = {}, a = Q();
  1046. let c = !1;
  1047. const b = (p, h) => An(this, void 0, void 0, function* () {
  1048. const {
  1049. beforeUpload: m
  1050. } = e;
  1051. let S = p;
  1052. if (m) {
  1053. try {
  1054. S = yield m(p, h);
  1055. } catch ($) {
  1056. S = !1;
  1057. }
  1058. if (S === !1)
  1059. return {
  1060. origin: p,
  1061. parsedFile: null,
  1062. action: null,
  1063. data: null
  1064. };
  1065. }
  1066. const {
  1067. action: E
  1068. } = e;
  1069. let L;
  1070. typeof E == "function" ? L = yield E(p) : L = E;
  1071. const {
  1072. data: M
  1073. } = e;
  1074. let U;
  1075. typeof M == "function" ? U = yield M(p) : U = M;
  1076. const N = (
  1077. // string type is from legacy `transformFile`.
  1078. // Not sure if this will work since no related test case works with it
  1079. (typeof S == "object" || typeof S == "string") && S ? S : p
  1080. );
  1081. let f;
  1082. N instanceof File ? f = N : f = new File([N], p.name, {
  1083. type: p.type
  1084. });
  1085. const w = f;
  1086. return w.uid = p.uid, {
  1087. origin: p,
  1088. data: U,
  1089. parsedFile: w,
  1090. action: L
  1091. };
  1092. }), u = (p) => {
  1093. let {
  1094. data: h,
  1095. origin: m,
  1096. action: S,
  1097. parsedFile: E
  1098. } = p;
  1099. if (!c)
  1100. return;
  1101. const {
  1102. onStart: L,
  1103. customRequest: M,
  1104. name: U,
  1105. headers: N,
  1106. withCredentials: f,
  1107. method: w
  1108. } = e, {
  1109. uid: $
  1110. } = m, C = M || On, x = {
  1111. action: S,
  1112. filename: U,
  1113. data: h,
  1114. file: E,
  1115. headers: N,
  1116. withCredentials: f,
  1117. method: w || "post",
  1118. onProgress: (A) => {
  1119. const {
  1120. onProgress: j
  1121. } = e;
  1122. j == null || j(A, E);
  1123. },
  1124. onSuccess: (A, j) => {
  1125. const {
  1126. onSuccess: T
  1127. } = e;
  1128. T == null || T(A, E, j), delete i[$];
  1129. },
  1130. onError: (A, j) => {
  1131. const {
  1132. onError: T
  1133. } = e;
  1134. T == null || T(A, j, E), delete i[$];
  1135. }
  1136. };
  1137. L(m), i[$] = C(x);
  1138. }, O = () => {
  1139. l.value = ye();
  1140. }, y = (p) => {
  1141. if (p) {
  1142. const h = p.uid ? p.uid : p;
  1143. i[h] && i[h].abort && i[h].abort(), delete i[h];
  1144. } else
  1145. Object.keys(i).forEach((h) => {
  1146. i[h] && i[h].abort && i[h].abort(), delete i[h];
  1147. });
  1148. };
  1149. ge(() => {
  1150. c = !0;
  1151. }), He(() => {
  1152. c = !1, y();
  1153. });
  1154. const g = (p) => {
  1155. const h = [...p], m = h.map((S) => (S.uid = ye(), b(S, h)));
  1156. Promise.all(m).then((S) => {
  1157. const {
  1158. onBatchStart: E
  1159. } = e;
  1160. E == null || E(S.map((L) => {
  1161. let {
  1162. origin: M,
  1163. parsedFile: U
  1164. } = L;
  1165. return {
  1166. file: M,
  1167. parsedFile: U
  1168. };
  1169. })), S.filter((L) => L.parsedFile !== null).forEach((L) => {
  1170. u(L);
  1171. });
  1172. });
  1173. }, F = (p) => {
  1174. const {
  1175. accept: h,
  1176. directory: m
  1177. } = e, {
  1178. files: S
  1179. } = p.target, E = [...S].filter((L) => !m || be(L, h));
  1180. g(E), O();
  1181. }, s = (p) => {
  1182. const h = a.value;
  1183. if (!h)
  1184. return;
  1185. const {
  1186. onClick: m
  1187. } = e;
  1188. h.click(), m && m(p);
  1189. }, v = (p) => {
  1190. p.key === "Enter" && s(p);
  1191. }, R = (p) => {
  1192. const {
  1193. multiple: h
  1194. } = e;
  1195. if (p.preventDefault(), p.type !== "dragover")
  1196. if (e.directory)
  1197. _n(Array.prototype.slice.call(p.dataTransfer.items), g, (m) => be(m, e.accept));
  1198. else {
  1199. const m = Kt(Array.prototype.slice.call(p.dataTransfer.files), (L) => be(L, e.accept));
  1200. let S = m[0];
  1201. const E = m[1];
  1202. h === !1 && (S = S.slice(0, 1)), g(S), E.length && e.onReject && e.onReject(E);
  1203. }
  1204. };
  1205. return r({
  1206. abort: y
  1207. }), () => {
  1208. var p;
  1209. const {
  1210. componentTag: h,
  1211. prefixCls: m,
  1212. disabled: S,
  1213. id: E,
  1214. multiple: L,
  1215. accept: M,
  1216. capture: U,
  1217. directory: N,
  1218. openFileDialogOnClick: f,
  1219. onMouseenter: w,
  1220. onMouseleave: $
  1221. } = e, C = Tn(e, ["componentTag", "prefixCls", "disabled", "id", "multiple", "accept", "capture", "directory", "openFileDialogOnClick", "onMouseenter", "onMouseleave"]), x = {
  1222. [m]: !0,
  1223. [`${m}-disabled`]: S,
  1224. [n.class]: !!n.class
  1225. }, A = N ? {
  1226. directory: "directory",
  1227. webkitdirectory: "webkitdirectory"
  1228. } : {};
  1229. return d(h, D(D({}, S ? {} : {
  1230. onClick: f ? s : () => {
  1231. },
  1232. onKeydown: f ? v : () => {
  1233. },
  1234. onMouseenter: w,
  1235. onMouseleave: $,
  1236. onDrop: R,
  1237. onDragover: R,
  1238. tabindex: "0"
  1239. }), {}, {
  1240. class: x,
  1241. role: "button",
  1242. style: n.style
  1243. }), {
  1244. default: () => [d("input", D(D(D({}, Ut(C, {
  1245. aria: !0,
  1246. data: !0
  1247. })), {}, {
  1248. id: E,
  1249. type: "file",
  1250. ref: a,
  1251. onClick: (T) => T.stopPropagation(),
  1252. onCancel: (T) => T.stopPropagation(),
  1253. key: l.value,
  1254. style: {
  1255. display: "none"
  1256. },
  1257. accept: M
  1258. }, A), {}, {
  1259. multiple: L,
  1260. onChange: F
  1261. }, U != null ? {
  1262. capture: U
  1263. } : {}), null), (p = o.default) === null || p === void 0 ? void 0 : p.call(o)]
  1264. });
  1265. };
  1266. }
  1267. });
  1268. function we() {
  1269. }
  1270. const Ee = z({
  1271. compatConfig: {
  1272. MODE: 3
  1273. },
  1274. name: "Upload",
  1275. inheritAttrs: !1,
  1276. props: ne(Ke(), {
  1277. componentTag: "span",
  1278. prefixCls: "rc-upload",
  1279. data: {},
  1280. headers: {},
  1281. name: "file",
  1282. multipart: !1,
  1283. onStart: we,
  1284. onError: we,
  1285. onSuccess: we,
  1286. multiple: !1,
  1287. beforeUpload: null,
  1288. customRequest: null,
  1289. withCredentials: !1,
  1290. openFileDialogOnClick: !0
  1291. }),
  1292. setup(e, t) {
  1293. let {
  1294. slots: o,
  1295. attrs: n,
  1296. expose: r
  1297. } = t;
  1298. const l = Q();
  1299. return r({
  1300. abort: (a) => {
  1301. var c;
  1302. (c = l.value) === null || c === void 0 || c.abort(a);
  1303. }
  1304. }), () => d(En, D(D(D({}, e), n), {}, {
  1305. ref: l
  1306. }), o);
  1307. }
  1308. });
  1309. function Ye() {
  1310. return {
  1311. capture: Z([Boolean, String]),
  1312. type: B(),
  1313. name: String,
  1314. defaultFileList: de(),
  1315. fileList: de(),
  1316. action: Z([String, Function]),
  1317. directory: W(),
  1318. data: Z([Object, Function]),
  1319. method: B(),
  1320. headers: q(),
  1321. showUploadList: Z([Boolean, Object]),
  1322. multiple: W(),
  1323. accept: String,
  1324. beforeUpload: I(),
  1325. onChange: I(),
  1326. "onUpdate:fileList": I(),
  1327. onDrop: I(),
  1328. listType: B(),
  1329. onPreview: I(),
  1330. onDownload: I(),
  1331. onReject: I(),
  1332. onRemove: I(),
  1333. /** @deprecated Please use `onRemove` directly */
  1334. remove: I(),
  1335. supportServerRender: W(),
  1336. disabled: W(),
  1337. prefixCls: String,
  1338. customRequest: I(),
  1339. withCredentials: W(),
  1340. openFileDialogOnClick: W(),
  1341. locale: q(),
  1342. id: String,
  1343. previewFile: I(),
  1344. /** @deprecated Please use `beforeUpload` directly */
  1345. transformFile: I(),
  1346. iconRender: I(),
  1347. isImageUrl: I(),
  1348. progress: q(),
  1349. itemRender: I(),
  1350. /** Config max count of `fileList`. Will replace current one when `maxCount` is 1 */
  1351. maxCount: Number,
  1352. height: Z([Number, String]),
  1353. removeIcon: I(),
  1354. downloadIcon: I(),
  1355. previewIcon: I()
  1356. };
  1357. }
  1358. function Ln() {
  1359. return {
  1360. listType: B(),
  1361. onPreview: I(),
  1362. onDownload: I(),
  1363. onRemove: I(),
  1364. items: de(),
  1365. progress: q(),
  1366. prefixCls: B(),
  1367. showRemoveIcon: W(),
  1368. showDownloadIcon: W(),
  1369. showPreviewIcon: W(),
  1370. removeIcon: I(),
  1371. downloadIcon: I(),
  1372. previewIcon: I(),
  1373. locale: q(void 0),
  1374. previewFile: I(),
  1375. iconRender: I(),
  1376. isImageUrl: I(),
  1377. appendAction: I(),
  1378. appendActionVisible: W(),
  1379. itemRender: I()
  1380. };
  1381. }
  1382. function se(e) {
  1383. return P(P({}, e), {
  1384. lastModified: e.lastModified,
  1385. lastModifiedDate: e.lastModifiedDate,
  1386. name: e.name,
  1387. size: e.size,
  1388. type: e.type,
  1389. uid: e.uid,
  1390. percent: 0,
  1391. originFileObj: e
  1392. });
  1393. }
  1394. function ae(e, t) {
  1395. const o = [...t], n = o.findIndex((r) => {
  1396. let {
  1397. uid: l
  1398. } = r;
  1399. return l === e.uid;
  1400. });
  1401. return n === -1 ? o.push(e) : o[n] = e, o;
  1402. }
  1403. function $e(e, t) {
  1404. const o = e.uid !== void 0 ? "uid" : "name";
  1405. return t.filter((n) => n[o] === e[o])[0];
  1406. }
  1407. function jn(e, t) {
  1408. const o = e.uid !== void 0 ? "uid" : "name", n = t.filter((r) => r[o] !== e[o]);
  1409. return n.length === t.length ? null : n;
  1410. }
  1411. const Un = function() {
  1412. const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "").split("/"), n = t[t.length - 1].split(/#|\?/)[0];
  1413. return (/\.[^./\\]*$/.exec(n) || [""])[0];
  1414. }, Je = (e) => e.indexOf("image/") === 0, kn = (e) => {
  1415. if (e.type && !e.thumbUrl)
  1416. return Je(e.type);
  1417. const t = e.thumbUrl || e.url || "", o = Un(t);
  1418. return /^data:image\//.test(t) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(o) ? !0 : !(/^data:/.test(t) || o);
  1419. }, Y = 200;
  1420. function Mn(e) {
  1421. return new Promise((t) => {
  1422. if (!e.type || !Je(e.type)) {
  1423. t("");
  1424. return;
  1425. }
  1426. const o = document.createElement("canvas");
  1427. o.width = Y, o.height = Y, o.style.cssText = `position: fixed; left: 0; top: 0; width: ${Y}px; height: ${Y}px; z-index: 9999; display: none;`, document.body.appendChild(o);
  1428. const n = o.getContext("2d"), r = new Image();
  1429. if (r.onload = () => {
  1430. const {
  1431. width: l,
  1432. height: i
  1433. } = r;
  1434. let a = Y, c = Y, b = 0, u = 0;
  1435. l > i ? (c = i * (Y / l), u = -(c - a) / 2) : (a = l * (Y / i), b = -(a - c) / 2), n.drawImage(r, b, u, a, c);
  1436. const O = o.toDataURL();
  1437. document.body.removeChild(o), t(O);
  1438. }, r.crossOrigin = "anonymous", e.type.startsWith("image/svg+xml")) {
  1439. const l = new FileReader();
  1440. l.addEventListener("load", () => {
  1441. l.result && (r.src = l.result);
  1442. }), l.readAsDataURL(e);
  1443. } else
  1444. r.src = window.URL.createObjectURL(e);
  1445. });
  1446. }
  1447. const Nn = () => ({
  1448. prefixCls: String,
  1449. locale: q(void 0),
  1450. file: q(),
  1451. items: de(),
  1452. listType: B(),
  1453. isImgUrl: I(),
  1454. showRemoveIcon: W(),
  1455. showDownloadIcon: W(),
  1456. showPreviewIcon: W(),
  1457. removeIcon: I(),
  1458. downloadIcon: I(),
  1459. previewIcon: I(),
  1460. iconRender: I(),
  1461. actionIconRender: I(),
  1462. itemRender: I(),
  1463. onPreview: I(),
  1464. onClose: I(),
  1465. onDownload: I(),
  1466. progress: q()
  1467. }), Wn = z({
  1468. compatConfig: {
  1469. MODE: 3
  1470. },
  1471. name: "ListItem",
  1472. inheritAttrs: !1,
  1473. props: Nn(),
  1474. setup(e, t) {
  1475. let {
  1476. slots: o,
  1477. attrs: n
  1478. } = t;
  1479. var r;
  1480. const l = le(!1), i = le();
  1481. ge(() => {
  1482. i.value = setTimeout(() => {
  1483. l.value = !0;
  1484. }, 300);
  1485. }), He(() => {
  1486. clearTimeout(i.value);
  1487. });
  1488. const a = le((r = e.file) === null || r === void 0 ? void 0 : r.status);
  1489. Ge(() => {
  1490. var u;
  1491. return (u = e.file) === null || u === void 0 ? void 0 : u.status;
  1492. }, (u) => {
  1493. u !== "removed" && (a.value = u);
  1494. });
  1495. const {
  1496. rootPrefixCls: c
  1497. } = fe("upload", e), b = _(() => ft(`${c.value}-fade`));
  1498. return () => {
  1499. var u, O;
  1500. const {
  1501. prefixCls: y,
  1502. locale: g,
  1503. listType: F,
  1504. file: s,
  1505. items: v,
  1506. progress: R,
  1507. iconRender: p = o.iconRender,
  1508. actionIconRender: h = o.actionIconRender,
  1509. itemRender: m = o.itemRender,
  1510. isImgUrl: S,
  1511. showPreviewIcon: E,
  1512. showRemoveIcon: L,
  1513. showDownloadIcon: M,
  1514. previewIcon: U = o.previewIcon,
  1515. removeIcon: N = o.removeIcon,
  1516. downloadIcon: f = o.downloadIcon,
  1517. onPreview: w,
  1518. onDownload: $,
  1519. onClose: C
  1520. } = e, {
  1521. class: x,
  1522. style: A
  1523. } = n, j = p({
  1524. file: s
  1525. });
  1526. let T = d("div", {
  1527. class: `${y}-text-icon`
  1528. }, [j]);
  1529. if (F === "picture" || F === "picture-card")
  1530. if (a.value === "uploading" || !s.thumbUrl && !s.url) {
  1531. const X = {
  1532. [`${y}-list-item-thumbnail`]: !0,
  1533. [`${y}-list-item-file`]: a.value !== "uploading"
  1534. };
  1535. T = d("div", {
  1536. class: X
  1537. }, [j]);
  1538. } else {
  1539. const X = S != null && S(s) ? d("img", {
  1540. src: s.thumbUrl || s.url,
  1541. alt: s.name,
  1542. class: `${y}-list-item-image`,
  1543. crossorigin: s.crossOrigin
  1544. }, null) : j, nt = {
  1545. [`${y}-list-item-thumbnail`]: !0,
  1546. [`${y}-list-item-file`]: S && !S(s)
  1547. };
  1548. T = d("a", {
  1549. class: nt,
  1550. onClick: (ot) => w(s, ot),
  1551. href: s.url || s.thumbUrl,
  1552. target: "_blank",
  1553. rel: "noopener noreferrer"
  1554. }, [X]);
  1555. }
  1556. const k = {
  1557. [`${y}-list-item`]: !0,
  1558. [`${y}-list-item-${a.value}`]: !0
  1559. }, V = typeof s.linkProps == "string" ? JSON.parse(s.linkProps) : s.linkProps, te = L ? h({
  1560. customIcon: N ? N({
  1561. file: s
  1562. }) : d(gt, null, null),
  1563. callback: () => C(s),
  1564. prefixCls: y,
  1565. title: g.removeFile
  1566. }) : null, H = M && a.value === "done" ? h({
  1567. customIcon: f ? f({
  1568. file: s
  1569. }) : d(mt, null, null),
  1570. callback: () => $(s),
  1571. prefixCls: y,
  1572. title: g.downloadFile
  1573. }) : null, G = F !== "picture-card" && d("span", {
  1574. key: "download-delete",
  1575. class: [`${y}-list-item-actions`, {
  1576. picture: F === "picture"
  1577. }]
  1578. }, [H, te]), K = `${y}-list-item-name`, oe = s.url ? [d("a", D(D({
  1579. key: "view",
  1580. target: "_blank",
  1581. rel: "noopener noreferrer",
  1582. class: K,
  1583. title: s.name
  1584. }, V), {}, {
  1585. href: s.url,
  1586. onClick: (X) => w(s, X)
  1587. }), [s.name]), G] : [d("span", {
  1588. key: "view",
  1589. class: K,
  1590. onClick: (X) => w(s, X),
  1591. title: s.name
  1592. }, [s.name]), G], he = {
  1593. pointerEvents: "none",
  1594. opacity: 0.5
  1595. }, Qe = E ? d("a", {
  1596. href: s.url || s.thumbUrl,
  1597. target: "_blank",
  1598. rel: "noopener noreferrer",
  1599. style: s.url || s.thumbUrl ? void 0 : he,
  1600. onClick: (X) => w(s, X),
  1601. title: g.previewFile
  1602. }, [U ? U({
  1603. file: s
  1604. }) : d(vt, null, null)]) : null, Ze = F === "picture-card" && a.value !== "uploading" && d("span", {
  1605. class: `${y}-list-item-actions`
  1606. }, [Qe, a.value === "done" && H, te]), Ie = d("div", {
  1607. class: k
  1608. }, [T, oe, Ze, l.value && d(At, b.value, {
  1609. default: () => [qe(d("div", {
  1610. class: `${y}-list-item-progress`
  1611. }, ["percent" in s ? d(In, D(D({}, R), {}, {
  1612. type: "line",
  1613. percent: s.percent
  1614. }), null) : null]), [[Ve, a.value === "uploading"]])]
  1615. })]), et = {
  1616. [`${y}-list-item-container`]: !0,
  1617. [`${x}`]: !!x
  1618. }, tt = s.response && typeof s.response == "string" ? s.response : ((u = s.error) === null || u === void 0 ? void 0 : u.statusText) || ((O = s.error) === null || O === void 0 ? void 0 : O.message) || g.uploadError, Pe = a.value === "error" ? d(ke, {
  1619. title: tt,
  1620. getPopupContainer: (X) => X.parentNode
  1621. }, {
  1622. default: () => [Ie]
  1623. }) : Ie;
  1624. return d("div", {
  1625. class: et,
  1626. style: A
  1627. }, [m ? m({
  1628. originNode: Pe,
  1629. file: s,
  1630. fileList: v,
  1631. actions: {
  1632. download: $.bind(null, s),
  1633. preview: w.bind(null, s),
  1634. remove: C.bind(null, s)
  1635. }
  1636. }) : Pe]);
  1637. };
  1638. }
  1639. }), Bn = (e, t) => {
  1640. let {
  1641. slots: o
  1642. } = t;
  1643. var n;
  1644. return bt((n = o.default) === null || n === void 0 ? void 0 : n.call(o))[0];
  1645. }, Xn = z({
  1646. compatConfig: {
  1647. MODE: 3
  1648. },
  1649. name: "AUploadList",
  1650. props: ne(Ln(), {
  1651. listType: "text",
  1652. progress: {
  1653. strokeWidth: 2,
  1654. showInfo: !1
  1655. },
  1656. showRemoveIcon: !0,
  1657. showDownloadIcon: !1,
  1658. showPreviewIcon: !0,
  1659. previewFile: Mn,
  1660. isImageUrl: kn,
  1661. items: [],
  1662. appendActionVisible: !0
  1663. }),
  1664. setup(e, t) {
  1665. let {
  1666. slots: o,
  1667. expose: n
  1668. } = t;
  1669. const r = le(!1);
  1670. ge(() => {
  1671. r.value == !0;
  1672. });
  1673. const l = le([]);
  1674. Ge(() => e.items, function() {
  1675. let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  1676. l.value = s.slice();
  1677. }, {
  1678. immediate: !0,
  1679. deep: !0
  1680. }), Tt(() => {
  1681. if (e.listType !== "picture" && e.listType !== "picture-card")
  1682. return;
  1683. let s = !1;
  1684. (e.items || []).forEach((v, R) => {
  1685. typeof document == "undefined" || typeof window == "undefined" || !window.FileReader || !window.File || !(v.originFileObj instanceof File || v.originFileObj instanceof Blob) || v.thumbUrl !== void 0 || (v.thumbUrl = "", e.previewFile && e.previewFile(v.originFileObj).then((p) => {
  1686. const h = p || "";
  1687. h !== v.thumbUrl && (l.value[R].thumbUrl = h, s = !0);
  1688. }));
  1689. }), s && Et(l);
  1690. });
  1691. const i = (s, v) => {
  1692. if (e.onPreview)
  1693. return v == null || v.preventDefault(), e.onPreview(s);
  1694. }, a = (s) => {
  1695. typeof e.onDownload == "function" ? e.onDownload(s) : s.url && window.open(s.url);
  1696. }, c = (s) => {
  1697. var v;
  1698. (v = e.onRemove) === null || v === void 0 || v.call(e, s);
  1699. }, b = (s) => {
  1700. let {
  1701. file: v
  1702. } = s;
  1703. const R = e.iconRender || o.iconRender;
  1704. if (R)
  1705. return R({
  1706. file: v,
  1707. listType: e.listType
  1708. });
  1709. const p = v.status === "uploading", h = e.isImageUrl && e.isImageUrl(v) ? d(wt, null, null) : d($t, null, null);
  1710. let m = p ? d(Oe, null, null) : d(Ct, null, null);
  1711. return e.listType === "picture" ? m = p ? d(Oe, null, null) : h : e.listType === "picture-card" && (m = p ? e.locale.uploading : h), m;
  1712. }, u = (s) => {
  1713. const {
  1714. customIcon: v,
  1715. callback: R,
  1716. prefixCls: p,
  1717. title: h
  1718. } = s, m = {
  1719. type: "text",
  1720. size: "small",
  1721. title: h,
  1722. onClick: () => {
  1723. R();
  1724. },
  1725. class: `${p}-list-item-action`
  1726. };
  1727. return St(v) ? d(De, m, {
  1728. icon: () => v
  1729. }) : d(De, m, {
  1730. default: () => [d("span", null, [v])]
  1731. });
  1732. };
  1733. n({
  1734. handlePreview: i,
  1735. handleDownload: a
  1736. });
  1737. const {
  1738. prefixCls: O,
  1739. rootPrefixCls: y
  1740. } = fe("upload", e), g = _(() => ({
  1741. [`${O.value}-list`]: !0,
  1742. [`${O.value}-list-${e.listType}`]: !0
  1743. })), F = _(() => {
  1744. const s = P({}, ht(`${y.value}-motion-collapse`));
  1745. delete s.onAfterAppear, delete s.onAfterEnter, delete s.onAfterLeave;
  1746. const v = P(P({}, yt(`${O.value}-${e.listType === "picture-card" ? "animate-inline" : "animate"}`)), {
  1747. class: g.value,
  1748. appear: r.value
  1749. });
  1750. return e.listType !== "picture-card" ? P(P({}, s), v) : v;
  1751. });
  1752. return () => {
  1753. const {
  1754. listType: s,
  1755. locale: v,
  1756. isImageUrl: R,
  1757. showPreviewIcon: p,
  1758. showRemoveIcon: h,
  1759. showDownloadIcon: m,
  1760. removeIcon: S,
  1761. previewIcon: E,
  1762. downloadIcon: L,
  1763. progress: M,
  1764. appendAction: U,
  1765. itemRender: N,
  1766. appendActionVisible: f
  1767. } = e, w = U == null ? void 0 : U(), $ = l.value;
  1768. return d(Lt, D(D({}, F.value), {}, {
  1769. tag: "div"
  1770. }), {
  1771. default: () => [$.map((C) => {
  1772. const {
  1773. uid: x
  1774. } = C;
  1775. return d(Wn, {
  1776. key: x,
  1777. locale: v,
  1778. prefixCls: O.value,
  1779. file: C,
  1780. items: $,
  1781. progress: M,
  1782. listType: s,
  1783. isImgUrl: R,
  1784. showPreviewIcon: p,
  1785. showRemoveIcon: h,
  1786. showDownloadIcon: m,
  1787. onPreview: i,
  1788. onDownload: a,
  1789. onClose: c,
  1790. removeIcon: S,
  1791. previewIcon: E,
  1792. downloadIcon: L,
  1793. itemRender: N
  1794. }, P(P({}, o), {
  1795. iconRender: b,
  1796. actionIconRender: u
  1797. }));
  1798. }), U ? qe(d(Bn, {
  1799. key: "__ant_upload_appendAction"
  1800. }, {
  1801. default: () => w
  1802. }), [[Ve, !!f]]) : null]
  1803. });
  1804. };
  1805. }
  1806. }), zn = (e) => {
  1807. const {
  1808. componentCls: t,
  1809. iconCls: o
  1810. } = e;
  1811. return {
  1812. [`${t}-wrapper`]: {
  1813. [`${t}-drag`]: {
  1814. position: "relative",
  1815. width: "100%",
  1816. height: "100%",
  1817. textAlign: "center",
  1818. background: e.colorFillAlter,
  1819. border: `${e.lineWidth}px dashed ${e.colorBorder}`,
  1820. borderRadius: e.borderRadiusLG,
  1821. cursor: "pointer",
  1822. transition: `border-color ${e.motionDurationSlow}`,
  1823. [t]: {
  1824. padding: `${e.padding}px 0`
  1825. },
  1826. [`${t}-btn`]: {
  1827. display: "table",
  1828. width: "100%",
  1829. height: "100%",
  1830. outline: "none"
  1831. },
  1832. [`${t}-drag-container`]: {
  1833. display: "table-cell",
  1834. verticalAlign: "middle"
  1835. },
  1836. [`&:not(${t}-disabled):hover`]: {
  1837. borderColor: e.colorPrimaryHover
  1838. },
  1839. [`p${t}-drag-icon`]: {
  1840. marginBottom: e.margin,
  1841. [o]: {
  1842. color: e.colorPrimary,
  1843. fontSize: e.uploadThumbnailSize
  1844. }
  1845. },
  1846. [`p${t}-text`]: {
  1847. margin: `0 0 ${e.marginXXS}px`,
  1848. color: e.colorTextHeading,
  1849. fontSize: e.fontSizeLG
  1850. },
  1851. [`p${t}-hint`]: {
  1852. color: e.colorTextDescription,
  1853. fontSize: e.fontSize
  1854. },
  1855. // ===================== Disabled =====================
  1856. [`&${t}-disabled`]: {
  1857. cursor: "not-allowed",
  1858. [`p${t}-drag-icon ${o},
  1859. p${t}-text,
  1860. p${t}-hint
  1861. `]: {
  1862. color: e.colorTextDisabled
  1863. }
  1864. }
  1865. }
  1866. }
  1867. };
  1868. }, Hn = (e) => {
  1869. const {
  1870. componentCls: t,
  1871. antCls: o,
  1872. iconCls: n,
  1873. fontSize: r,
  1874. lineHeight: l
  1875. } = e, i = `${t}-list-item`, a = `${i}-actions`, c = `${i}-action`, b = Math.round(r * l);
  1876. return {
  1877. [`${t}-wrapper`]: {
  1878. [`${t}-list`]: P(P({}, Be()), {
  1879. lineHeight: e.lineHeight,
  1880. [i]: {
  1881. position: "relative",
  1882. height: e.lineHeight * r,
  1883. marginTop: e.marginXS,
  1884. fontSize: r,
  1885. display: "flex",
  1886. alignItems: "center",
  1887. transition: `background-color ${e.motionDurationSlow}`,
  1888. "&:hover": {
  1889. backgroundColor: e.controlItemBgHover
  1890. },
  1891. [`${i}-name`]: P(P({}, Xe), {
  1892. padding: `0 ${e.paddingXS}px`,
  1893. lineHeight: l,
  1894. flex: "auto",
  1895. transition: `all ${e.motionDurationSlow}`
  1896. }),
  1897. [a]: {
  1898. [c]: {
  1899. opacity: 0
  1900. },
  1901. [`${c}${o}-btn-sm`]: {
  1902. height: b,
  1903. border: 0,
  1904. lineHeight: 1,
  1905. // FIXME: should not override small button
  1906. "> span": {
  1907. transform: "scale(1)"
  1908. }
  1909. },
  1910. [`
  1911. ${c}:focus,
  1912. &.picture ${c}
  1913. `]: {
  1914. opacity: 1
  1915. },
  1916. [n]: {
  1917. color: e.colorTextDescription,
  1918. transition: `all ${e.motionDurationSlow}`
  1919. },
  1920. [`&:hover ${n}`]: {
  1921. color: e.colorText
  1922. }
  1923. },
  1924. [`${t}-icon ${n}`]: {
  1925. color: e.colorTextDescription,
  1926. fontSize: r
  1927. },
  1928. [`${i}-progress`]: {
  1929. position: "absolute",
  1930. bottom: -e.uploadProgressOffset,
  1931. width: "100%",
  1932. paddingInlineStart: r + e.paddingXS,
  1933. fontSize: r,
  1934. lineHeight: 0,
  1935. pointerEvents: "none",
  1936. "> div": {
  1937. margin: 0
  1938. }
  1939. }
  1940. },
  1941. [`${i}:hover ${c}`]: {
  1942. opacity: 1,
  1943. color: e.colorText
  1944. },
  1945. [`${i}-error`]: {
  1946. color: e.colorError,
  1947. [`${i}-name, ${t}-icon ${n}`]: {
  1948. color: e.colorError
  1949. },
  1950. [a]: {
  1951. [`${n}, ${n}:hover`]: {
  1952. color: e.colorError
  1953. },
  1954. [c]: {
  1955. opacity: 1
  1956. }
  1957. }
  1958. },
  1959. [`${t}-list-item-container`]: {
  1960. transition: `opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,
  1961. // For smooth removing animation
  1962. "&::before": {
  1963. display: "table",
  1964. width: 0,
  1965. height: 0,
  1966. content: '""'
  1967. }
  1968. }
  1969. })
  1970. }
  1971. };
  1972. }, Le = new xe("uploadAnimateInlineIn", {
  1973. from: {
  1974. width: 0,
  1975. height: 0,
  1976. margin: 0,
  1977. padding: 0,
  1978. opacity: 0
  1979. }
  1980. }), je = new xe("uploadAnimateInlineOut", {
  1981. to: {
  1982. width: 0,
  1983. height: 0,
  1984. margin: 0,
  1985. padding: 0,
  1986. opacity: 0
  1987. }
  1988. }), Gn = (e) => {
  1989. const {
  1990. componentCls: t
  1991. } = e, o = `${t}-animate-inline`;
  1992. return [{
  1993. [`${t}-wrapper`]: {
  1994. [`${o}-appear, ${o}-enter, ${o}-leave`]: {
  1995. animationDuration: e.motionDurationSlow,
  1996. animationTimingFunction: e.motionEaseInOutCirc,
  1997. animationFillMode: "forwards"
  1998. },
  1999. [`${o}-appear, ${o}-enter`]: {
  2000. animationName: Le
  2001. },
  2002. [`${o}-leave`]: {
  2003. animationName: je
  2004. }
  2005. }
  2006. }, Le, je];
  2007. }, qn = (e) => {
  2008. const {
  2009. componentCls: t,
  2010. iconCls: o,
  2011. uploadThumbnailSize: n,
  2012. uploadProgressOffset: r
  2013. } = e, l = `${t}-list`, i = `${l}-item`;
  2014. return {
  2015. [`${t}-wrapper`]: {
  2016. // ${listCls} 增加优先级
  2017. [`${l}${l}-picture, ${l}${l}-picture-card`]: {
  2018. [i]: {
  2019. position: "relative",
  2020. height: n + e.lineWidth * 2 + e.paddingXS * 2,
  2021. padding: e.paddingXS,
  2022. border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,
  2023. borderRadius: e.borderRadiusLG,
  2024. "&:hover": {
  2025. background: "transparent"
  2026. },
  2027. [`${i}-thumbnail`]: P(P({}, Xe), {
  2028. width: n,
  2029. height: n,
  2030. lineHeight: `${n + e.paddingSM}px`,
  2031. textAlign: "center",
  2032. flex: "none",
  2033. [o]: {
  2034. fontSize: e.fontSizeHeading2,
  2035. color: e.colorPrimary
  2036. },
  2037. img: {
  2038. display: "block",
  2039. width: "100%",
  2040. height: "100%",
  2041. overflow: "hidden"
  2042. }
  2043. }),
  2044. [`${i}-progress`]: {
  2045. bottom: r,
  2046. width: `calc(100% - ${e.paddingSM * 2}px)`,
  2047. marginTop: 0,
  2048. paddingInlineStart: n + e.paddingXS
  2049. }
  2050. },
  2051. [`${i}-error`]: {
  2052. borderColor: e.colorError,
  2053. // Adjust the color of the error icon : https://github.com/ant-design/ant-design/pull/24160
  2054. [`${i}-thumbnail ${o}`]: {
  2055. "svg path[fill='#e6f7ff']": {
  2056. fill: e.colorErrorBg
  2057. },
  2058. "svg path[fill='#1890ff']": {
  2059. fill: e.colorError
  2060. }
  2061. }
  2062. },
  2063. [`${i}-uploading`]: {
  2064. borderStyle: "dashed",
  2065. [`${i}-name`]: {
  2066. marginBottom: r
  2067. }
  2068. }
  2069. }
  2070. }
  2071. };
  2072. }, Vn = (e) => {
  2073. const {
  2074. componentCls: t,
  2075. iconCls: o,
  2076. fontSizeLG: n,
  2077. colorTextLightSolid: r
  2078. } = e, l = `${t}-list`, i = `${l}-item`, a = e.uploadPicCardSize;
  2079. return {
  2080. [`${t}-wrapper${t}-picture-card-wrapper`]: P(P({}, Be()), {
  2081. display: "inline-block",
  2082. width: "100%",
  2083. [`${t}${t}-select`]: {
  2084. width: a,
  2085. height: a,
  2086. marginInlineEnd: e.marginXS,
  2087. marginBottom: e.marginXS,
  2088. textAlign: "center",
  2089. verticalAlign: "top",
  2090. backgroundColor: e.colorFillAlter,
  2091. border: `${e.lineWidth}px dashed ${e.colorBorder}`,
  2092. borderRadius: e.borderRadiusLG,
  2093. cursor: "pointer",
  2094. transition: `border-color ${e.motionDurationSlow}`,
  2095. [`> ${t}`]: {
  2096. display: "flex",
  2097. alignItems: "center",
  2098. justifyContent: "center",
  2099. height: "100%",
  2100. textAlign: "center"
  2101. },
  2102. [`&:not(${t}-disabled):hover`]: {
  2103. borderColor: e.colorPrimary
  2104. }
  2105. },
  2106. // list
  2107. [`${l}${l}-picture-card`]: {
  2108. [`${l}-item-container`]: {
  2109. display: "inline-block",
  2110. width: a,
  2111. height: a,
  2112. marginBlock: `0 ${e.marginXS}px`,
  2113. marginInline: `0 ${e.marginXS}px`,
  2114. verticalAlign: "top"
  2115. },
  2116. "&::after": {
  2117. display: "none"
  2118. },
  2119. [i]: {
  2120. height: "100%",
  2121. margin: 0,
  2122. "&::before": {
  2123. position: "absolute",
  2124. zIndex: 1,
  2125. width: `calc(100% - ${e.paddingXS * 2}px)`,
  2126. height: `calc(100% - ${e.paddingXS * 2}px)`,
  2127. backgroundColor: e.colorBgMask,
  2128. opacity: 0,
  2129. transition: `all ${e.motionDurationSlow}`,
  2130. content: '" "'
  2131. }
  2132. },
  2133. [`${i}:hover`]: {
  2134. [`&::before, ${i}-actions`]: {
  2135. opacity: 1
  2136. }
  2137. },
  2138. [`${i}-actions`]: {
  2139. position: "absolute",
  2140. insetInlineStart: 0,
  2141. zIndex: 10,
  2142. width: "100%",
  2143. whiteSpace: "nowrap",
  2144. textAlign: "center",
  2145. opacity: 0,
  2146. transition: `all ${e.motionDurationSlow}`,
  2147. [`${o}-eye, ${o}-download, ${o}-delete`]: {
  2148. zIndex: 10,
  2149. width: n,
  2150. margin: `0 ${e.marginXXS}px`,
  2151. fontSize: n,
  2152. cursor: "pointer",
  2153. transition: `all ${e.motionDurationSlow}`
  2154. }
  2155. },
  2156. [`${i}-actions, ${i}-actions:hover`]: {
  2157. [`${o}-eye, ${o}-download, ${o}-delete`]: {
  2158. color: new xt(r).setAlpha(0.65).toRgbString(),
  2159. "&:hover": {
  2160. color: r
  2161. }
  2162. }
  2163. },
  2164. [`${i}-thumbnail, ${i}-thumbnail img`]: {
  2165. position: "static",
  2166. display: "block",
  2167. width: "100%",
  2168. height: "100%",
  2169. objectFit: "contain"
  2170. },
  2171. [`${i}-name`]: {
  2172. display: "none",
  2173. textAlign: "center"
  2174. },
  2175. [`${i}-file + ${i}-name`]: {
  2176. position: "absolute",
  2177. bottom: e.margin,
  2178. display: "block",
  2179. width: `calc(100% - ${e.paddingXS * 2}px)`
  2180. },
  2181. [`${i}-uploading`]: {
  2182. [`&${i}`]: {
  2183. backgroundColor: e.colorFillAlter
  2184. },
  2185. [`&::before, ${o}-eye, ${o}-download, ${o}-delete`]: {
  2186. display: "none"
  2187. }
  2188. },
  2189. [`${i}-progress`]: {
  2190. bottom: e.marginXL,
  2191. width: `calc(100% - ${e.paddingXS * 2}px)`,
  2192. paddingInlineStart: 0
  2193. }
  2194. }
  2195. })
  2196. };
  2197. }, Kn = (e) => {
  2198. const {
  2199. componentCls: t
  2200. } = e;
  2201. return {
  2202. [`${t}-rtl`]: {
  2203. direction: "rtl"
  2204. }
  2205. };
  2206. }, Yn = (e) => {
  2207. const {
  2208. componentCls: t,
  2209. colorTextDisabled: o
  2210. } = e;
  2211. return {
  2212. [`${t}-wrapper`]: P(P({}, We(e)), {
  2213. [t]: {
  2214. outline: 0,
  2215. "input[type='file']": {
  2216. cursor: "pointer"
  2217. }
  2218. },
  2219. [`${t}-select`]: {
  2220. display: "inline-block"
  2221. },
  2222. [`${t}-disabled`]: {
  2223. color: o,
  2224. cursor: "not-allowed"
  2225. }
  2226. })
  2227. };
  2228. }, Jn = Me("Upload", (e) => {
  2229. const {
  2230. fontSizeHeading3: t,
  2231. fontSize: o,
  2232. lineHeight: n,
  2233. lineWidth: r,
  2234. controlHeightLG: l
  2235. } = e, i = Math.round(o * n), a = Ne(e, {
  2236. uploadThumbnailSize: t * 2,
  2237. uploadProgressOffset: i / 2 + r,
  2238. uploadPicCardSize: l * 2.55
  2239. });
  2240. return [Yn(a), zn(a), qn(a), Vn(a), Hn(a), Gn(a), Kn(a), It(a)];
  2241. });
  2242. var Qn = function(e, t, o, n) {
  2243. function r(l) {
  2244. return l instanceof o ? l : new o(function(i) {
  2245. i(l);
  2246. });
  2247. }
  2248. return new (o || (o = Promise))(function(l, i) {
  2249. function a(u) {
  2250. try {
  2251. b(n.next(u));
  2252. } catch (O) {
  2253. i(O);
  2254. }
  2255. }
  2256. function c(u) {
  2257. try {
  2258. b(n.throw(u));
  2259. } catch (O) {
  2260. i(O);
  2261. }
  2262. }
  2263. function b(u) {
  2264. u.done ? l(u.value) : r(u.value).then(a, c);
  2265. }
  2266. b((n = n.apply(e, t || [])).next());
  2267. });
  2268. }, Zn = function(e, t) {
  2269. var o = {};
  2270. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  2271. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  2272. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  2273. return o;
  2274. };
  2275. const ie = `__LIST_IGNORE_${Date.now()}__`, ce = z({
  2276. compatConfig: {
  2277. MODE: 3
  2278. },
  2279. name: "AUpload",
  2280. inheritAttrs: !1,
  2281. props: ne(Ye(), {
  2282. type: "select",
  2283. multiple: !1,
  2284. action: "",
  2285. data: {},
  2286. accept: "",
  2287. showUploadList: !0,
  2288. listType: "text",
  2289. supportServerRender: !0
  2290. }),
  2291. setup(e, t) {
  2292. let {
  2293. slots: o,
  2294. attrs: n,
  2295. expose: r
  2296. } = t;
  2297. const l = Nt(), {
  2298. prefixCls: i,
  2299. direction: a,
  2300. disabled: c
  2301. } = fe("upload", e), [b, u] = Jn(i), O = Pt(), y = _(() => {
  2302. var f;
  2303. return (f = c.value) !== null && f !== void 0 ? f : O.value;
  2304. }), [g, F] = Mt(e.defaultFileList || [], {
  2305. value: jt(e, "fileList"),
  2306. postState: (f) => {
  2307. const w = Date.now();
  2308. return (f != null ? f : []).map(($, C) => (!$.uid && !Object.isFrozen($) && ($.uid = `__AUTO__${w}_${C}__`), $));
  2309. }
  2310. }), s = Q("drop"), v = Q(null);
  2311. ge(() => {
  2312. J(e.fileList !== void 0 || n.value === void 0, "Upload", "`value` is not a valid prop, do you mean `fileList`?"), J(e.transformFile === void 0, "Upload", "`transformFile` is deprecated. Please use `beforeUpload` directly."), J(e.remove === void 0, "Upload", "`remove` props is deprecated. Please use `remove` event.");
  2313. });
  2314. const R = (f, w, $) => {
  2315. var C, x;
  2316. let A = [...w];
  2317. e.maxCount === 1 ? A = A.slice(-1) : e.maxCount && (A = A.slice(0, e.maxCount)), F(A);
  2318. const j = {
  2319. file: f,
  2320. fileList: A
  2321. };
  2322. $ && (j.event = $), (C = e["onUpdate:fileList"]) === null || C === void 0 || C.call(e, j.fileList), (x = e.onChange) === null || x === void 0 || x.call(e, j), l.onFieldChange();
  2323. }, p = (f, w) => Qn(this, void 0, void 0, function* () {
  2324. const {
  2325. beforeUpload: $,
  2326. transformFile: C
  2327. } = e;
  2328. let x = f;
  2329. if ($) {
  2330. const A = yield $(f, w);
  2331. if (A === !1)
  2332. return !1;
  2333. if (delete f[ie], A === ie)
  2334. return Object.defineProperty(f, ie, {
  2335. value: !0,
  2336. configurable: !0
  2337. }), !1;
  2338. typeof A == "object" && A && (x = A);
  2339. }
  2340. return C && (x = yield C(x)), x;
  2341. }), h = (f) => {
  2342. const w = f.filter((x) => !x.file[ie]);
  2343. if (!w.length)
  2344. return;
  2345. const $ = w.map((x) => se(x.file));
  2346. let C = [...g.value];
  2347. $.forEach((x) => {
  2348. C = ae(x, C);
  2349. }), $.forEach((x, A) => {
  2350. let j = x;
  2351. if (w[A].parsedFile)
  2352. x.status = "uploading";
  2353. else {
  2354. const {
  2355. originFileObj: T
  2356. } = x;
  2357. let k;
  2358. try {
  2359. k = new File([T], T.name, {
  2360. type: T.type
  2361. });
  2362. } catch (V) {
  2363. k = new Blob([T], {
  2364. type: T.type
  2365. }), k.name = T.name, k.lastModifiedDate = /* @__PURE__ */ new Date(), k.lastModified = (/* @__PURE__ */ new Date()).getTime();
  2366. }
  2367. k.uid = x.uid, j = k;
  2368. }
  2369. R(j, C);
  2370. });
  2371. }, m = (f, w, $) => {
  2372. try {
  2373. typeof f == "string" && (f = JSON.parse(f));
  2374. } catch (A) {
  2375. }
  2376. if (!$e(w, g.value))
  2377. return;
  2378. const C = se(w);
  2379. C.status = "done", C.percent = 100, C.response = f, C.xhr = $;
  2380. const x = ae(C, g.value);
  2381. R(C, x);
  2382. }, S = (f, w) => {
  2383. if (!$e(w, g.value))
  2384. return;
  2385. const $ = se(w);
  2386. $.status = "uploading", $.percent = f.percent;
  2387. const C = ae($, g.value);
  2388. R($, C, f);
  2389. }, E = (f, w, $) => {
  2390. if (!$e($, g.value))
  2391. return;
  2392. const C = se($);
  2393. C.error = f, C.response = w, C.status = "error";
  2394. const x = ae(C, g.value);
  2395. R(C, x);
  2396. }, L = (f) => {
  2397. let w;
  2398. const $ = e.onRemove || e.remove;
  2399. Promise.resolve(typeof $ == "function" ? $(f) : $).then((C) => {
  2400. var x, A;
  2401. if (C === !1)
  2402. return;
  2403. const j = jn(f, g.value);
  2404. j && (w = P(P({}, f), {
  2405. status: "removed"
  2406. }), (x = g.value) === null || x === void 0 || x.forEach((T) => {
  2407. const k = w.uid !== void 0 ? "uid" : "name";
  2408. T[k] === w[k] && !Object.isFrozen(T) && (T.status = "removed");
  2409. }), (A = v.value) === null || A === void 0 || A.abort(w), R(w, j));
  2410. });
  2411. }, M = (f) => {
  2412. var w;
  2413. s.value = f.type, f.type === "drop" && ((w = e.onDrop) === null || w === void 0 || w.call(e, f));
  2414. };
  2415. r({
  2416. onBatchStart: h,
  2417. onSuccess: m,
  2418. onProgress: S,
  2419. onError: E,
  2420. fileList: g,
  2421. upload: v
  2422. });
  2423. const [U] = Ot("Upload", Dt.Upload, _(() => e.locale)), N = (f, w) => {
  2424. const {
  2425. removeIcon: $,
  2426. previewIcon: C,
  2427. downloadIcon: x,
  2428. previewFile: A,
  2429. onPreview: j,
  2430. onDownload: T,
  2431. isImageUrl: k,
  2432. progress: V,
  2433. itemRender: te,
  2434. iconRender: H,
  2435. showUploadList: G
  2436. } = e, {
  2437. showDownloadIcon: K,
  2438. showPreviewIcon: oe,
  2439. showRemoveIcon: he
  2440. } = typeof G == "boolean" ? {} : G;
  2441. return G ? d(Xn, {
  2442. prefixCls: i.value,
  2443. listType: e.listType,
  2444. items: g.value,
  2445. previewFile: A,
  2446. onPreview: j,
  2447. onDownload: T,
  2448. onRemove: L,
  2449. showRemoveIcon: !y.value && he,
  2450. showPreviewIcon: oe,
  2451. showDownloadIcon: K,
  2452. removeIcon: $,
  2453. previewIcon: C,
  2454. downloadIcon: x,
  2455. iconRender: H,
  2456. locale: U.value,
  2457. isImageUrl: k,
  2458. progress: V,
  2459. itemRender: te,
  2460. appendActionVisible: w,
  2461. appendAction: f
  2462. }, P({}, o)) : f == null ? void 0 : f();
  2463. };
  2464. return () => {
  2465. var f, w, $;
  2466. const {
  2467. listType: C,
  2468. type: x
  2469. } = e, {
  2470. class: A,
  2471. style: j
  2472. } = n, T = Zn(n, ["class", "style"]), k = P(P(P({
  2473. onBatchStart: h,
  2474. onError: E,
  2475. onProgress: S,
  2476. onSuccess: m
  2477. }, T), e), {
  2478. id: (f = e.id) !== null && f !== void 0 ? f : l.id.value,
  2479. prefixCls: i.value,
  2480. beforeUpload: p,
  2481. onChange: void 0,
  2482. disabled: y.value
  2483. });
  2484. delete k.remove, (!o.default || y.value) && delete k.id;
  2485. const V = {
  2486. [`${i.value}-rtl`]: a.value === "rtl"
  2487. };
  2488. if (x === "drag") {
  2489. const K = re(i.value, {
  2490. [`${i.value}-drag`]: !0,
  2491. [`${i.value}-drag-uploading`]: g.value.some((oe) => oe.status === "uploading"),
  2492. [`${i.value}-drag-hover`]: s.value === "dragover",
  2493. [`${i.value}-disabled`]: y.value,
  2494. [`${i.value}-rtl`]: a.value === "rtl"
  2495. }, n.class, u.value);
  2496. return b(d("span", D(D({}, n), {}, {
  2497. class: re(`${i.value}-wrapper`, V, A, u.value)
  2498. }), [d("div", {
  2499. class: K,
  2500. onDrop: M,
  2501. onDragover: M,
  2502. onDragleave: M,
  2503. style: n.style
  2504. }, [d(Ee, D(D({}, k), {}, {
  2505. ref: v,
  2506. class: `${i.value}-btn`
  2507. }), D({
  2508. default: () => [d("div", {
  2509. class: `${i.value}-drag-container`
  2510. }, [(w = o.default) === null || w === void 0 ? void 0 : w.call(o)])]
  2511. }, o))]), N()]));
  2512. }
  2513. const te = re(i.value, {
  2514. [`${i.value}-select`]: !0,
  2515. [`${i.value}-select-${C}`]: !0,
  2516. [`${i.value}-disabled`]: y.value,
  2517. [`${i.value}-rtl`]: a.value === "rtl"
  2518. }), H = Ft(($ = o.default) === null || $ === void 0 ? void 0 : $.call(o)), G = (K) => d("div", {
  2519. class: te,
  2520. style: K
  2521. }, [d(Ee, D(D({}, k), {}, {
  2522. ref: v
  2523. }), o)]);
  2524. return b(C === "picture-card" ? d("span", D(D({}, n), {}, {
  2525. class: re(`${i.value}-wrapper`, `${i.value}-picture-card-wrapper`, V, n.class, u.value)
  2526. }), [N(G, !!(H && H.length))]) : d("span", D(D({}, n), {}, {
  2527. class: re(`${i.value}-wrapper`, V, n.class, u.value)
  2528. }), [G(H && H.length ? void 0 : {
  2529. display: "none"
  2530. }), N()]));
  2531. };
  2532. }
  2533. });
  2534. var Ue = function(e, t) {
  2535. var o = {};
  2536. for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
  2537. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
  2538. t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
  2539. return o;
  2540. };
  2541. const ue = z({
  2542. compatConfig: {
  2543. MODE: 3
  2544. },
  2545. name: "AUploadDragger",
  2546. inheritAttrs: !1,
  2547. props: Ye(),
  2548. setup(e, t) {
  2549. let {
  2550. slots: o,
  2551. attrs: n
  2552. } = t;
  2553. return () => {
  2554. const {
  2555. height: r
  2556. } = e, l = Ue(e, ["height"]), {
  2557. style: i
  2558. } = n, a = Ue(n, ["style"]), c = P(P(P({}, l), a), {
  2559. type: "drag",
  2560. style: P(P({}, i), {
  2561. height: typeof r == "number" ? `${r}px` : r
  2562. })
  2563. });
  2564. return d(ce, c, o);
  2565. };
  2566. }
  2567. }), lo = ue, so = P(ce, {
  2568. Dragger: ue,
  2569. LIST_IGNORE: ie,
  2570. install(e) {
  2571. return e.component(ce.name, ce), e.component(ue.name, ue), e;
  2572. }
  2573. });
  2574. export {
  2575. lo as U,
  2576. so as _
  2577. };