460 lines
72 KiB
JavaScript
460 lines
72 KiB
JavaScript
import{G as e,H as t,In as n,K as r,Mt as i,Pt as a,Rt as o,U as s,Ut as c,Vt as l,Y as u,_n as d,an as f,at as p,bt as m,d as h,dt as g,f as _,g as v,gt as y,hn as b,ht as x,it as S,kt as C,nn as w,nt as T,ot as E,p as D,q as O,qt as k,rn as A,st as j,tt as M,vn as ee}from"./client-Cr-cm5gA.js";import{u as N}from"./Follower-Dcotonxv.js";import{d as P,u as F}from"./Card-BXfpL_-k.js";import{f as I,i as te,n as ne,p as re}from"./Suffix-lZCP2rA2.js";import{t as ie}from"./use-merged-state-3avmaBFV.js";import{t as ae}from"./use-compitable-BGh6qEk0.js";import{a as L,t as R}from"./Button-htLGEUWP.js";import{n as oe,t as se}from"./Popover-2LGFIrFs.js";import{i as z,s as B}from"./_plugin-vue_export-helper-D-vCjaLb.js";import{o as V}from"./get-CBoyaL19.js";import{n as H}from"./use-form-item-D5MDIr54.js";import{t as ce}from"./Add-C0eb93oO.js";import{n as le}from"./Input-Dj4f4oJP.js";import{t as ue}from"./fade-in.cssr-Q4qxrdA6.js";import{$ as de,B as fe,D as pe,G as U,H as W,I as G,K,Q as me,R as q,U as J,V as he,W as ge,Z as _e,a as ve,at as ye,b as Y,nt as X,o as be,u as xe,z as Se}from"./index-BDx9g-XU.js";function Ce(e,t){if(!e)return;let n=document.createElement(`a`);n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}function we(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Te(e){return function(t){return e?.[t]}}var Ee=Te({À:`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`}),De=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Oe=RegExp(`[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]`,`g`);function ke(e){return e=K(e),e&&e.replace(De,Ee).replace(Oe,``)}var Ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function je(e){return e.match(Ae)||[]}var Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Ne(e){return Me.test(e)}var Pe=`\\ud800-\\udfff`,Fe=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Ie=`\\u2700-\\u27bf`,Le=`a-z\\xdf-\\xf6\\xf8-\\xff`,Re=`\\xac\\xb1\\xd7\\xf7`,ze=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,Be=`\\u2000-\\u206f`,Ve=` \\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`,He=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ue=`\\ufe0e\\ufe0f`,We=Re+ze+Be+Ve,Ge=`['’]`,Ke=`[`+We+`]`,qe=`[`+Fe+`]`,Je=`\\d+`,Ye=`[`+Ie+`]`,Xe=`[`+Le+`]`,Ze=`[^`+Pe+We+Je+Ie+Le+He+`]`,Qe=`(?:`+qe+`|\\ud83c[\\udffb-\\udfff])`,$e=`[^`+Pe+`]`,et=`(?:\\ud83c[\\udde6-\\uddff]){2}`,tt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Z=`[`+He+`]`,nt=`\\u200d`,rt=`(?:`+Xe+`|`+Ze+`)`,it=`(?:`+Z+`|`+Ze+`)`,at=`(?:`+Ge+`(?:d|ll|m|re|s|t|ve))?`,ot=`(?:`+Ge+`(?:D|LL|M|RE|S|T|VE))?`,st=Qe+`?`,ct=`[`+Ue+`]?`,lt=`(?:`+nt+`(?:`+[$e,et,tt].join(`|`)+`)`+ct+st+`)*`,ut=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,dt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,ft=ct+st+lt,pt=`(?:`+[Ye,et,tt].join(`|`)+`)`+ft,mt=RegExp([Z+`?`+Xe+`+`+at+`(?=`+[Ke,Z,`$`].join(`|`)+`)`,it+`+`+ot+`(?=`+[Ke,Z+rt,`$`].join(`|`)+`)`,Z+`?`+rt+`+`+at,Z+`+`+ot,dt,ut,Je,pt].join(`|`),`g`);function ht(e){return e.match(mt)||[]}function gt(e,t,n){return e=K(e),t=n?void 0:t,t===void 0?Ne(e)?ht(e):je(e):e.match(t)||[]}var _t=RegExp(`['’]`,`g`);function vt(e){return function(t){return we(gt(ke(t).replace(_t,``)),e,``)}}var yt=vt(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),bt=J(`attach`,()=>i(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},i(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},i(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},i(`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`}))))),xt=J(`cancel`,()=>i(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},i(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},i(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},i(`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`}))))),St=J(`download`,()=>i(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},i(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},i(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},i(`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`}))))),Ct=C({name:`ResizeSmall`,render(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},i(`g`,{fill:`none`},i(`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`})))}}),wt=J(`retry`,()=>i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`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;`}),i(`polyline`,{points:`256 58 336 138 256 218`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),Tt=J(`rotateClockwise`,()=>i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}),i(`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`}))),Et=J(`rotateClockwise`,()=>i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}),i(`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`}))),Dt=J(`trash`,()=>i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`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;`}),i(`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;`}),i(`line`,{x1:`312`,y1:`240`,x2:`200`,y2:`352`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}),i(`line`,{x1:`312`,y1:`352`,x2:`200`,y2:`240`,style:`fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;`}))),Ot=J(`zoomIn`,()=>i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}),i(`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`}))),kt=J(`zoomOut`,()=>i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}),i(`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`}))),At=L&&`loading`in document.createElement(`img`);function jt(e={}){let{root:t=null}=e;return{hash:`${e.rootMargin||`0px 0px 0px 0px`}-${Array.isArray(e.threshold)?e.threshold.join(`,`):e.threshold??`0`}`,options:Object.assign(Object.assign({},e),{root:(typeof t==`string`?document.querySelector(t):t)||document.documentElement})}}var Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,Ft=(e,t,n)=>{if(!e)return()=>{};let r=jt(t),{root:i}=r.options,a,o=Mt.get(i);o?a=o:(a=new Map,Mt.set(i,a));let s,c;a.has(r.hash)?(c=a.get(r.hash),c[1].has(e)||(s=c[0],c[1].add(e),s.observe(e))):(s=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let t=Nt.get(e.target),n=Pt.get(e.target);t&&t(),n&&(n.value=!0)}})},r.options),s.observe(e),c=[s,new Set([e])],a.set(r.hash,c));let l=!1,u=()=>{l||(Nt.delete(e),Pt.delete(e),l=!0,c[1].has(e)&&(c[0].unobserve(e),c[1].delete(e)),c[1].size<=0&&a.delete(r.hash),a.size||Mt.delete(i))};return Nt.set(e,u),Pt.set(e,n),u},It=C({name:`Tooltip`,props:Object.assign(Object.assign({},oe),D.props),slots:Object,__popover__:!0,setup(e){let{mergedClsPrefixRef:t}=s(e),n=D(`Tooltip`,`-tooltip`,void 0,Y,e,t),r=b(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(e){r.value.setShow(e)}}),{popoverRef:r,mergedTheme:n,popoverThemeOverrides:m(()=>n.value.self)})},render(){let{mergedTheme:e,internalExtraClass:t}=this;return i(se,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat(`tooltip`),ref:`popoverRef`}),this.$slots)}});function Lt(){return{toolbarIconColor:`rgba(255, 255, 255, .9)`,toolbarColor:`rgba(0, 0, 0, .35)`,toolbarBoxShadow:`none`,toolbarBorderRadius:`24px`}}var Rt=_({name:`Image`,common:h,peers:{Tooltip:Y},self:Lt});function zt(){return i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}))}function Bt(){return i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}))}function Vt(){return i(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},i(`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`}))}var Ht=Object.assign(Object.assign({},D.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean,renderToolbar:Function}),Ut=u(`n-image`),Wt=M([M(`body >`,[T(`image-container`,`position: fixed;`)]),T(`image-preview-container`,`
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
`),T(`image-preview-overlay`,`
|
||
z-index: -1;
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
background: rgba(0, 0, 0, .3);
|
||
`,[ue()]),T(`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;
|
||
`,[T(`base-icon`,`
|
||
padding: 0 8px;
|
||
font-size: 28px;
|
||
cursor: pointer;
|
||
`),ue()]),T(`image-preview-wrapper`,`
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
top: 0;
|
||
bottom: 0;
|
||
display: flex;
|
||
pointer-events: none;
|
||
`,[ne()]),T(`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);
|
||
`),T(`image`,`
|
||
display: inline-flex;
|
||
max-height: 100%;
|
||
max-width: 100%;
|
||
`,[E(`preview-disabled`,`
|
||
cursor: pointer;
|
||
`),M(`img`,`
|
||
border-radius: inherit;
|
||
`)])]),Gt=32,Kt=C({name:`ImagePreview`,props:Object.assign(Object.assign({},Ht),{src:String,show:{type:Boolean,default:void 0},defaultShow:Boolean,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onNext:Function,onPrev:Function,onClose:[Function,Array]}),setup(e){let{src:r}=ee(e),{mergedClsPrefixRef:o}=s(e),c=D(`Image`,`-image`,Wt,Rt,e,o),u=null,f=b(null),p=b(null),h=b(!1),{localeRef:g}=te(`Image`),_=b(e.defaultShow),v=ie(d(e,`show`),_);function y(){let{value:e}=p;if(!u||!e)return;let{style:t}=e,n=u.getBoundingClientRect();t.transformOrigin=`${n.left+n.width/2}px ${n.top+n.height/2}px`}function x(t){var n,r;switch(t.key){case` `:t.preventDefault();break;case`ArrowLeft`:(n=e.onPrev)==null||n.call(e);break;case`ArrowRight`:(r=e.onNext)==null||r.call(e);break;case`ArrowUp`:t.preventDefault(),G();break;case`ArrowDown`:t.preventDefault(),K();break;case`Escape`:J();break}}function S(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&B(n,t),r&&B(r,t),_.value=t,h.value=!0}w(v,e=>{e?P(`keydown`,document,x):F(`keydown`,document,x)}),l(()=>{F(`keydown`,document,x)});let C=0,T=0,E=0,O=0,k=0,A=0,j=0,M=0,I=!1;function ne(e){let{clientX:t,clientY:n}=e;E=t-C,O=n-T,N(q)}function re(e){let{mouseUpClientX:t,mouseUpClientY:n,mouseDownClientX:r,mouseDownClientY:i}=e,a=r-t,o=i-n;return{moveVerticalDirection:`vertical${o>0?`Top`:`Bottom`}`,moveHorizontalDirection:`horizontal${a>0?`Left`:`Right`}`,deltaHorizontal:a,deltaVertical:o}}function ae(e){let{value:t}=f;if(!t)return{offsetX:0,offsetY:0};let n=t.getBoundingClientRect(),{moveVerticalDirection:r,moveHorizontalDirection:i,deltaHorizontal:a,deltaVertical:o}=e||{},s=0,c=0;return s=n.width<=window.innerWidth?0:n.left>0?(n.width-window.innerWidth)/2:n.right<window.innerWidth?-(n.width-window.innerWidth)/2:i===`horizontalRight`?Math.min((n.width-window.innerWidth)/2,k-(a??0)):Math.max(-((n.width-window.innerWidth)/2),k-(a??0)),c=n.height<=window.innerHeight?0:n.top>0?(n.height-window.innerHeight)/2:n.bottom<window.innerHeight?-(n.height-window.innerHeight)/2:r===`verticalBottom`?Math.min((n.height-window.innerHeight)/2,A-(o??0)):Math.max(-((n.height-window.innerHeight)/2),A-(o??0)),{offsetX:s,offsetY:c}}function L(e){F(`mousemove`,document,ne),F(`mouseup`,document,L);let{clientX:t,clientY:n}=e;I=!1;let r=ae(re({mouseUpClientX:t,mouseUpClientY:n,mouseDownClientX:j,mouseDownClientY:M}));E=r.offsetX,O=r.offsetY,q()}let R=a(Ut,null);function oe(e){var t,n;if((n=(t=R?.previewedImgPropsRef.value)?.onMousedown)==null||n.call(t,e),e.button!==0)return;let{clientX:r,clientY:i}=e;I=!0,C=r-E,T=i-O,k=E,A=O,j=r,M=i,q(),P(`mousemove`,document,ne),P(`mouseup`,document,L)}let se=1.5,z=0,V=1,H=0;function ce(e){var t,n;(n=(t=R?.previewedImgPropsRef.value)?.onDblclick)==null||n.call(t,e);let r=W();V=V===r?1:r,q()}function le(){V=1,z=0}function ue(){var t;le(),H=0,(t=e.onPrev)==null||t.call(e)}function de(){var t;le(),H=0,(t=e.onNext)==null||t.call(e)}function fe(){H-=90,q()}function pe(){H+=90,q()}function U(){let{value:e}=f;if(!e)return 1;let{innerWidth:t,innerHeight:n}=window,r=Math.max(1,e.naturalHeight/(n-Gt)),i=Math.max(1,e.naturalWidth/(t-Gt));return Math.max(3,r*2,i*2)}function W(){let{value:e}=f;if(!e)return 1;let{innerWidth:t,innerHeight:n}=window,r=e.naturalHeight/(n-Gt),i=e.naturalWidth/(t-Gt);return r<1&&i<1?1:Math.max(r,i)}function G(){let e=U();V<e&&(z+=1,V=Math.min(e,se**z),q())}function K(){if(V>.5){let e=V;--z,V=Math.max(.5,se**z);let t=e-V;q(!1);let n=ae();V+=t,q(!1),V-=t,E=n.offsetX,O=n.offsetY,q()}}function me(){let e=r.value;e&&Ce(e,void 0)}function q(e=!0){let{value:t}=f;if(!t)return;let{style:r}=t,i=n(R?.previewedImgPropsRef.value?.style),a=``;if(typeof i==`string`)a=`${i};`;else for(let e in i)a+=`${yt(e)}: ${i[e]};`;let o=`transform-origin: center; transform: translateX(${E}px) translateY(${O}px) rotate(${H}deg) scale(${V});`;I?r.cssText=`${a}cursor: grabbing; transition: none;${o}`:r.cssText=`${a}cursor: grab;${o}${e?``:`transition: none;`}`,e||t.offsetHeight}function J(){if(v.value){let{onClose:t}=e;t&&B(t),S(!1),_.value=!1}}function he(){V=W(),z=Math.ceil(Math.log(V)/Math.log(se)),E=0,O=0,q()}let ge={setThumbnailEl:e=>{u=e}};function ve(t,n){if(e.showToolbarTooltip){let{value:e}=c;return i(It,{to:!1,theme:e.peers.Tooltip,themeOverrides:e.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>g.value[n],trigger:()=>t})}else return t}let ye=m(()=>{let{common:{cubicBezierEaseInOut:e},self:{toolbarIconColor:t,toolbarBorderRadius:n,toolbarBoxShadow:r,toolbarColor:i}}=c.value;return{"--n-bezier":e,"--n-toolbar-icon-color":t,"--n-toolbar-color":i,"--n-toolbar-border-radius":n,"--n-toolbar-box-shadow":r}}),{inlineThemeDisabled:Y}=s(),X=Y?t(`image-preview`,void 0,ye,e):void 0;function be(e){e.preventDefault()}return Object.assign({clsPrefix:o,previewRef:f,previewWrapperRef:p,previewSrc:r,mergedShow:v,appear:_e(),displayed:h,previewedImgProps:R?.previewedImgPropsRef,handleWheel:be,handlePreviewMousedown:oe,handlePreviewDblclick:ce,syncTransformOrigin:y,handleAfterLeave:()=>{le(),H=0,h.value=!1},handleDragStart:e=>{var t,n;(n=(t=R?.previewedImgPropsRef.value)?.onDragstart)==null||n.call(t,e),e.preventDefault()},zoomIn:G,zoomOut:K,handleDownloadClick:me,rotateCounterclockwise:fe,rotateClockwise:pe,handleSwitchPrev:ue,handleSwitchNext:de,withTooltip:ve,resizeToOrignalImageSize:he,cssVars:Y?void 0:ye,themeClass:X?.themeClass,onRender:X?.onRender,doUpdateShow:S,close:J},ge)},render(){var e;let{clsPrefix:t,renderToolbar:n,withTooltip:r}=this,a=r(i(U,{clsPrefix:t,onClick:this.handleSwitchPrev},{default:zt}),`tipPrevious`),o=r(i(U,{clsPrefix:t,onClick:this.handleSwitchNext},{default:Bt}),`tipNext`),s=r(i(U,{clsPrefix:t,onClick:this.rotateCounterclockwise},{default:()=>i(Et,null)}),`tipCounterclockwise`),c=r(i(U,{clsPrefix:t,onClick:this.rotateClockwise},{default:()=>i(Tt,null)}),`tipClockwise`),l=r(i(U,{clsPrefix:t,onClick:this.resizeToOrignalImageSize},{default:()=>i(Ct,null)}),`tipOriginalSize`),u=r(i(U,{clsPrefix:t,onClick:this.zoomOut},{default:()=>i(kt,null)}),`tipZoomOut`),d=r(i(U,{clsPrefix:t,onClick:this.handleDownloadClick},{default:()=>i(St,null)}),`tipDownload`),p=r(i(U,{clsPrefix:t,onClick:()=>this.close()},{default:Vt}),`tipClose`),m=r(i(U,{clsPrefix:t,onClick:this.zoomIn},{default:()=>i(Ot,null)}),`tipZoomIn`);return i(x,null,(e=this.$slots).default?.call(e),i(I,{show:this.mergedShow},{default:()=>{var e;return this.mergedShow||this.displayed?((e=this.onRender)==null||e.call(this),f(i(`div`,{ref:`containerRef`,class:[`${t}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},i(X,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?i(`div`,{class:`${t}-image-preview-overlay`,onClick:()=>this.close()}):null}),this.showToolbar?i(X,{name:`fade-in-transition`,appear:this.appear},{default:()=>this.mergedShow?i(`div`,{class:`${t}-image-preview-toolbar`},n?n({nodes:{prev:a,next:o,rotateCounterclockwise:s,rotateClockwise:c,resizeToOriginalSize:l,zoomOut:u,zoomIn:m,download:d,close:p}}):i(x,null,this.onPrev?i(x,null,a,o):null,s,c,l,u,m,d,p)):null}):null,i(X,{name:`fade-in-scale-up-transition`,onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{let{previewedImgProps:e={}}=this;return f(i(`div`,{class:`${t}-image-preview-wrapper`,ref:`previewWrapperRef`},i(`img`,Object.assign({},e,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${t}-image-preview`,e.class],key:this.previewSrc,src:this.previewSrc,ref:`previewRef`,onDragstart:this.handleDragStart}))),[[ye,this.mergedShow]])}})),[[re,{enabled:this.mergedShow}]])):null}}))}}),qt=u(`n-image-group`),Jt=C({name:`ImageGroup`,props:Object.assign(Object.assign({},Ht),{srcList:Array,current:Number,defaultCurrent:{type:Number,default:0},show:{type:Boolean,default:void 0},defaultShow:Boolean,onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],onUpdateCurrent:[Function,Array],"onUpdate:current":[Function,Array]}),setup(e){let{mergedClsPrefixRef:t}=s(e),n=`c${de()}`,i=b(null),a=b(e.defaultShow),o=ie(d(e,`show`),a),c=b(new Map),l=m(()=>{if(e.srcList){let t=new Map;return e.srcList.forEach((e,n)=>{t.set(`p${n}`,e)}),t}return c.value}),u=m(()=>Array.from(l.value.keys())),f=()=>u.value.length;function p(t,n){e.srcList&&r(`image-group`,"`n-image` can't be placed inside `n-image-group` when image group's `src-list` prop is set.");let i=`r${t}`;return c.value.has(`r${i}`)||c.value.set(i,n),function(){c.value.has(i)||c.value.delete(i)}}let h=b(e.defaultCurrent),g=ie(d(e,`current`),h),_=t=>{if(t!==g.value){let{onUpdateCurrent:n,"onUpdate:current":r}=e;n&&B(n,t),r&&B(r,t),h.value=t}},v=m(()=>u.value[g.value]),y=e=>{let t=u.value.indexOf(e);t!==g.value&&_(t)},x=m(()=>l.value.get(v.value));function S(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&B(n,t),r&&B(r,t),a.value=t}function C(){S(!1)}let w=m(()=>{let e=(e,t)=>{for(let n=e;n<=t;n++){let e=u.value[n];if(l.value.get(e))return n}},t=e(g.value+1,f()-1);return t===void 0?e(0,g.value-1):t}),T=m(()=>{let e=(e,t)=>{for(let n=e;n>=t;n--){let e=u.value[n];if(l.value.get(e))return n}},t=e(g.value-1,0);return t===void 0?e(f()-1,g.value+1):t});function E(t){var n,r;t===1?(T.value!==void 0&&_(w.value),(n=e.onPreviewNext)==null||n.call(e)):(w.value!==void 0&&_(T.value),(r=e.onPreviewPrev)==null||r.call(e))}return k(qt,{mergedClsPrefixRef:t,registerImageUrl:p,setThumbnailEl:e=>{var t;(t=i.value)==null||t.setThumbnailEl(e)},toggleShow:e=>{S(!0),y(e)},groupId:n,renderToolbarRef:d(e,`renderToolbar`)}),{mergedClsPrefix:t,previewInstRef:i,mergedShow:o,src:x,onClose:C,next:()=>{E(1)},prev:()=>{E(-1)}}},render(){return i(Kt,{theme:this.theme,themeOverrides:this.themeOverrides,ref:`previewInstRef`,onPrev:this.prev,onNext:this.next,src:this.src,show:this.mergedShow,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar,onClose:this.onClose},this.$slots)}}),Yt=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},Ht),Xt=0,Zt=C({name:`Image`,props:Yt,slots:Object,inheritAttrs:!1,setup(e){let t=b(null),n=b(!1),r=b(null),i=a(qt,null),{mergedClsPrefixRef:o}=i||s(e),u=m(()=>e.previewSrc||e.src),f=b(!1),p=Xt++,h=()=>{if(e.previewDisabled||n.value)return;if(i){i.setThumbnailEl(t.value),i.toggleShow(`r${p}`);return}let{value:a}=r;a&&(a.setThumbnailEl(t.value),f.value=!0)},g={click:()=>{h()},showPreview:h},_=b(!e.lazy);c(()=>{var e;(e=t.value)==null||e.setAttribute(`data-group-id`,i?.groupId||``)}),c(()=>{if(e.lazy&&e.intersectionObserverOptions){let n,r=A(()=>{n?.(),n=void 0,n=Ft(t.value,e.intersectionObserverOptions,_)});l(()=>{r(),n?.()})}}),A(()=>{var t;e.src||(t=e.imgProps)==null||t.src,n.value=!1}),A(e=>{let t=(i?.registerImageUrl)?.call(i,p,u.value||``);e(()=>{t?.()})});function v(t){var n,r;g.showPreview(),(r=(n=e.imgProps)?.onClick)==null||r.call(n,t)}function y(){f.value=!1}let x=b(!1);return k(Ut,{previewedImgPropsRef:d(e,`previewedImgProps`)}),Object.assign({mergedClsPrefix:o,groupId:i?.groupId,previewInstRef:r,imageRef:t,mergedPreviewSrc:u,showError:n,shouldStartLoading:_,loaded:x,mergedOnClick:e=>{v(e)},onPreviewClose:y,mergedOnError:t=>{if(!_.value)return;n.value=!0;let{onError:r,imgProps:{onError:i}={}}=e;r?.(t),i?.(t)},mergedOnLoad:t=>{let{onLoad:n,imgProps:{onLoad:r}={}}=e;n?.(t),r?.(t),x.value=!0},previewShow:f},g)},render(){var e;let{mergedClsPrefix:t,imgProps:n={},loaded:r,$attrs:a,lazy:o}=this,s=z(this.$slots.error,()=>[]),c=(e=this.$slots).placeholder?.call(e),l=this.src||n.src,u=this.showError&&s.length?s:i(`img`,Object.assign(Object.assign({},n),{ref:`imageRef`,width:this.width||n.width,height:this.height||n.height,src:this.showError?this.fallbackSrc:o&&this.intersectionObserverOptions?this.shouldStartLoading?l:void 0:l,alt:this.alt||n.alt,"aria-label":this.alt||n.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:At&&o&&!this.intersectionObserverOptions?`lazy`:`eager`,style:[n.style||``,c&&!r?{height:`0`,width:`0`,visibility:`hidden`}:``,{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return i(`div`,Object.assign({},a,{role:`none`,class:[a.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?u:i(Kt,{theme:this.theme,themeOverrides:this.themeOverrides,ref:`previewInstRef`,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip,renderToolbar:this.renderToolbar,src:this.mergedPreviewSrc,show:!this.previewDisabled&&this.previewShow,onClose:this.onPreviewClose},{default:()=>u}),!r&&c)}}),Qt={success:i(fe,null),error:i(W,null),warning:i(Se,null),info:i(he,null)},$t=C({name:`ProgressCircle`,props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:[String,Object],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:t}){let n=m(()=>{let t=`gradient`,{fillColor:n}=e;return typeof n==`object`?`${t}-${g(JSON.stringify(n))}`:t});function r(t,r,i,a){let{gapDegree:o,viewBoxWidth:s,strokeWidth:c}=e,l=50+c/2,u=`M ${l},${l} m 0,50
|
||
a 50,50 0 1 1 0,-100
|
||
a 50,50 0 1 1 0,100`,d=Math.PI*2*50;return{pathString:u,pathStyle:{stroke:a===`rail`?i:typeof e.fillColor==`object`?`url(#${n.value})`:i,strokeDasharray:`${Math.min(t,100)/100*(d-o)}px ${s*8}px`,strokeDashoffset:`-${o/2}px`,transformOrigin:r?`center`:void 0,transform:r?`rotate(${r}deg)`:void 0}}}let a=()=>{let t=typeof e.fillColor==`object`,r=t?e.fillColor.stops[0]:``,a=t?e.fillColor.stops[1]:``;return t&&i(`defs`,null,i(`linearGradient`,{id:n.value,x1:`0%`,y1:`100%`,x2:`100%`,y2:`0%`},i(`stop`,{offset:`0%`,"stop-color":r}),i(`stop`,{offset:`100%`,"stop-color":a})))};return()=>{let{fillColor:n,railColor:o,strokeWidth:s,offsetDegree:c,status:l,percentage:u,showIndicator:d,indicatorTextColor:f,unit:p,gapOffsetDegree:m,clsPrefix:h}=e,{pathString:g,pathStyle:_}=r(100,0,o,`rail`),{pathString:v,pathStyle:y}=r(u,c,n,`fill`),b=100+s;return i(`div`,{class:`${h}-progress-content`,role:`none`},i(`div`,{class:`${h}-progress-graph`,"aria-hidden":!0},i(`div`,{class:`${h}-progress-graph-circle`,style:{transform:m?`rotate(${m}deg)`:void 0}},i(`svg`,{viewBox:`0 0 ${b} ${b}`},a(),i(`g`,null,i(`path`,{class:`${h}-progress-graph-circle-rail`,d:g,"stroke-width":s,"stroke-linecap":`round`,fill:`none`,style:_})),i(`g`,null,i(`path`,{class:[`${h}-progress-graph-circle-fill`,u===0&&`${h}-progress-graph-circle-fill--empty`],d:v,"stroke-width":s,"stroke-linecap":`round`,fill:`none`,style:y}))))),d?i(`div`,null,t.default?i(`div`,{class:`${h}-progress-custom-content`,role:`none`},t.default()):l==="default"?i(`div`,{class:`${h}-progress-text`,style:{color:f},role:`none`},i(`span`,{class:`${h}-progress-text__percentage`},u),i(`span`,{class:`${h}-progress-text__unit`},p)):i(`div`,{class:`${h}-progress-icon`,"aria-hidden":!0},i(U,{clsPrefix:h},{default:()=>Qt[l]}))):null)}}}),en={success:i(fe,null),error:i(W,null),warning:i(Se,null),info:i(he,null)},tn=C({name:`ProgressLine`,props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:[String,Object],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:t}){let n=m(()=>V(e.height)),r=m(()=>typeof e.fillColor==`object`?`linear-gradient(to right, ${e.fillColor?.stops[0]} , ${e.fillColor?.stops[1]})`:e.fillColor),a=m(()=>e.railBorderRadius===void 0?e.height===void 0?``:V(e.height,{c:.5}):V(e.railBorderRadius)),o=m(()=>e.fillBorderRadius===void 0?e.railBorderRadius===void 0?e.height===void 0?``:V(e.height,{c:.5}):V(e.railBorderRadius):V(e.fillBorderRadius));return()=>{let{indicatorPlacement:s,railColor:c,railStyle:l,percentage:u,unit:d,indicatorTextColor:f,status:p,showIndicator:m,processing:h,clsPrefix:g}=e;return i(`div`,{class:`${g}-progress-content`,role:`none`},i(`div`,{class:`${g}-progress-graph`,"aria-hidden":!0},i(`div`,{class:[`${g}-progress-graph-line`,{[`${g}-progress-graph-line--indicator-${s}`]:!0}]},i(`div`,{class:`${g}-progress-graph-line-rail`,style:[{backgroundColor:c,height:n.value,borderRadius:a.value},l]},i(`div`,{class:[`${g}-progress-graph-line-fill`,h&&`${g}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,background:r.value,height:n.value,lineHeight:n.value,borderRadius:o.value}},s===`inside`?i(`div`,{class:`${g}-progress-graph-line-indicator`,style:{color:f}},t.default?t.default():`${u}${d}`):null)))),m&&s===`outside`?i(`div`,null,t.default?i(`div`,{class:`${g}-progress-custom-content`,style:{color:f},role:`none`},t.default()):p==="default"?i(`div`,{role:`none`,class:`${g}-progress-icon ${g}-progress-icon--as-text`,style:{color:f}},u,d):i(`div`,{class:`${g}-progress-icon`,"aria-hidden":!0},i(U,{clsPrefix:g},{default:()=>en[p]}))):null)}}});function nn(e,t,n=100){return`m ${n/2} ${n/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}var rn=C({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:t}){let n=m(()=>e.percentage.map((t,n)=>`${Math.PI*t/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*n)-e.circleGap*n)*2}, ${e.viewBoxWidth*8}`)),r=(t,n)=>{let r=e.fillColor[n],a=typeof r==`object`?r.stops[0]:``,o=typeof r==`object`?r.stops[1]:``;return typeof e.fillColor[n]==`object`&&i(`linearGradient`,{id:`gradient-${n}`,x1:`100%`,y1:`0%`,x2:`0%`,y2:`100%`},i(`stop`,{offset:`0%`,"stop-color":a}),i(`stop`,{offset:`100%`,"stop-color":o}))};return()=>{let{viewBoxWidth:a,strokeWidth:o,circleGap:s,showIndicator:c,fillColor:l,railColor:u,railStyle:d,percentage:f,clsPrefix:p}=e;return i(`div`,{class:`${p}-progress-content`,role:`none`},i(`div`,{class:`${p}-progress-graph`,"aria-hidden":!0},i(`div`,{class:`${p}-progress-graph-circle`},i(`svg`,{viewBox:`0 0 ${a} ${a}`},i(`defs`,null,f.map((e,t)=>r(e,t))),f.map((e,t)=>i(`g`,{key:t},i(`path`,{class:`${p}-progress-graph-circle-rail`,d:nn(a/2-o/2*(1+2*t)-s*t,o,a),"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:[{strokeDashoffset:0,stroke:u[t]},d[t]]}),i(`path`,{class:[`${p}-progress-graph-circle-fill`,e===0&&`${p}-progress-graph-circle-fill--empty`],d:nn(a/2-o/2*(1+2*t)-s*t,o,a),"stroke-width":o,"stroke-linecap":`round`,fill:`none`,style:{strokeDasharray:n.value[t],strokeDashoffset:0,stroke:typeof l[t]==`object`?`url(#gradient-${t})`:l[t]}})))))),c&&t.default?i(`div`,null,i(`div`,{class:`${p}-progress-text`},t.default())):null)}}}),an=M([T(`progress`,{display:`inline-block`},[T(`progress-icon`,`
|
||
color: var(--n-icon-color);
|
||
transition: color .3s var(--n-bezier);
|
||
`),p(`line`,`
|
||
width: 100%;
|
||
display: block;
|
||
`,[T(`progress-content`,`
|
||
display: flex;
|
||
align-items: center;
|
||
`,[T(`progress-graph`,{flex:1})]),T(`progress-custom-content`,{marginLeft:`14px`}),T(`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);
|
||
`,[p(`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);
|
||
`)])]),p(`circle, dashboard`,{width:`120px`},[T(`progress-custom-content`,`
|
||
position: absolute;
|
||
left: 50%;
|
||
top: 50%;
|
||
transform: translateX(-50%) translateY(-50%);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
`),T(`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;
|
||
`),T(`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);
|
||
`)]),p(`multiple-circle`,`
|
||
width: 200px;
|
||
color: inherit;
|
||
`,[T(`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);
|
||
`)]),T(`progress-content`,{position:`relative`}),T(`progress-graph`,{position:`relative`},[T(`progress-graph-circle`,[M(`svg`,{verticalAlign:`bottom`}),T(`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);
|
||
`,[p(`empty`,{opacity:0})]),T(`progress-graph-circle-rail`,`
|
||
transition: stroke .3s var(--n-bezier);
|
||
overflow: hidden;
|
||
stroke: var(--n-rail-color);
|
||
`)]),T(`progress-graph-line`,[p(`indicator-inside`,[T(`progress-graph-line-rail`,`
|
||
height: 16px;
|
||
line-height: 16px;
|
||
border-radius: 10px;
|
||
`,[T(`progress-graph-line-fill`,`
|
||
height: inherit;
|
||
border-radius: 10px;
|
||
`),T(`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);
|
||
`)])]),p(`indicator-inside-label`,`
|
||
height: 16px;
|
||
display: flex;
|
||
align-items: center;
|
||
`,[T(`progress-graph-line-rail`,`
|
||
flex: 1;
|
||
transition: background-color .3s var(--n-bezier);
|
||
`),T(`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);
|
||
`)]),T(`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);
|
||
`,[T(`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);
|
||
`,[p(`processing`,[M(`&::after`,`
|
||
content: "";
|
||
background-image: var(--n-line-bg-processing);
|
||
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
||
`)])])])])])]),M(`@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;
|
||
}
|
||
`)]),on=C({name:`Progress`,props:Object.assign(Object.assign({},D.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,Object],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}),setup(e){let n=m(()=>e.indicatorPlacement||e.indicatorPosition),r=m(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type===`dashboard`)return 75}),{mergedClsPrefixRef:i,inlineThemeDisabled:a}=s(e),o=D(`Progress`,`-progress`,an,xe,e,i),c=m(()=>{let{status:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontSize:r,fontSizeCircle:i,railColor:a,railHeight:s,iconSizeCircle:c,iconSizeLine:l,textColorCircle:u,textColorLineInner:d,textColorLineOuter:f,lineBgProcessing:p,fontWeightCircle:m,[j(`iconColor`,t)]:h,[j(`fillColor`,t)]:g}}=o.value;return{"--n-bezier":n,"--n-fill-color":g,"--n-font-size":r,"--n-font-size-circle":i,"--n-font-weight-circle":m,"--n-icon-color":h,"--n-icon-size-circle":c,"--n-icon-size-line":l,"--n-line-bg-processing":p,"--n-rail-color":a,"--n-rail-height":s,"--n-text-color-circle":u,"--n-text-color-line-inner":d,"--n-text-color-line-outer":f}}),l=a?t(`progress`,m(()=>e.status[0]),c,e):void 0;return{mergedClsPrefix:i,mergedIndicatorPlacement:n,gapDeg:r,cssVars:a?void 0:c,themeClass:l?.themeClass,onRender:l?.onRender}},render(){let{type:e,cssVars:t,indicatorTextColor:n,showIndicator:r,status:a,railColor:o,railStyle:s,color:c,percentage:l,viewBoxWidth:u,strokeWidth:d,mergedIndicatorPlacement:f,unit:p,borderRadius:m,fillBorderRadius:h,height:g,processing:_,circleGap:v,mergedClsPrefix:y,gapDeg:b,gapOffsetDegree:x,themeClass:S,$slots:C,onRender:w}=this;return w?.(),i(`div`,{class:[S,`${y}-progress`,`${y}-progress--${e}`,`${y}-progress--${a}`],style:t,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":l,role:e===`circle`||e===`line`||e===`dashboard`?`progressbar`:`none`},e===`circle`||e===`dashboard`?i($t,{clsPrefix:y,status:a,showIndicator:r,indicatorTextColor:n,railColor:o,fillColor:c,railStyle:s,offsetDegree:this.offsetDegree,percentage:l,viewBoxWidth:u,strokeWidth:d,gapDegree:b===void 0?e===`dashboard`?75:0:b,gapOffsetDegree:x,unit:p},C):e===`line`?i(tn,{clsPrefix:y,status:a,showIndicator:r,indicatorTextColor:n,railColor:o,fillColor:c,railStyle:s,percentage:l,processing:_,indicatorPlacement:f,unit:p,fillBorderRadius:h,railBorderRadius:m,height:g},C):e===`multiple-circle`?i(rn,{clsPrefix:y,strokeWidth:d,railColor:o,fillColor:c,railStyle:s,viewBoxWidth:u,percentage:l,showIndicator:r,circleGap:v},C):null)}}),sn=T(`text`,`
|
||
transition: color .3s var(--n-bezier);
|
||
color: var(--n-text-color);
|
||
`,[p(`strong`,`
|
||
font-weight: var(--n-font-weight-strong);
|
||
`),p(`italic`,{fontStyle:`italic`}),p(`underline`,{textDecoration:`underline`}),p(`code`,`
|
||
line-height: 1.4;
|
||
display: inline-block;
|
||
font-family: var(--n-font-famliy-mono);
|
||
transition:
|
||
color .3s var(--n-bezier),
|
||
border-color .3s var(--n-bezier),
|
||
background-color .3s var(--n-bezier);
|
||
box-sizing: border-box;
|
||
padding: .05em .35em 0 .35em;
|
||
border-radius: var(--n-code-border-radius);
|
||
font-size: .9em;
|
||
color: var(--n-code-text-color);
|
||
background-color: var(--n-code-color);
|
||
border: var(--n-code-border);
|
||
`)]),cn=C({name:`Text`,props:Object.assign(Object.assign({},D.props),{code:Boolean,type:{type:String,default:`default`},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),setup(e){let{mergedClsPrefixRef:n,inlineThemeDisabled:r}=s(e),i=D(`Typography`,`-text`,sn,be,e,n),a=m(()=>{let{depth:t,type:n}=e,r=n==="default"?t===void 0?`textColor`:`textColor${t}Depth`:j(`textColor`,n),{common:{fontWeightStrong:a,fontFamilyMono:o,cubicBezierEaseInOut:s},self:{codeTextColor:c,codeBorderRadius:l,codeColor:u,codeBorder:d,[r]:f}}=i.value;return{"--n-bezier":s,"--n-text-color":f,"--n-font-weight-strong":a,"--n-font-famliy-mono":o,"--n-code-border-radius":l,"--n-code-text-color":c,"--n-code-color":u,"--n-code-border":d}}),o=r?t(`text`,m(()=>`${e.type[0]}${e.depth||``}`),a,e):void 0;return{mergedClsPrefix:n,compitableTag:ae(e,[`as`,`tag`]),cssVars:r?void 0:a,themeClass:o?.themeClass,onRender:o?.onRender}},render(){var e,t;let{mergedClsPrefix:n}=this;(e=this.onRender)==null||e.call(this);let r=[`${n}-text`,this.themeClass,{[`${n}-text--code`]:this.code,[`${n}-text--delete`]:this.delete,[`${n}-text--strong`]:this.strong,[`${n}-text--italic`]:this.italic,[`${n}-text--underline`]:this.underline}],a=(t=this.$slots).default?.call(t);return this.code?i(`code`,{class:r,style:this.cssVars},this.delete?i(`del`,null,a):a):this.delete?i(`del`,{class:r,style:this.cssVars},a):i(this.compitableTag||`span`,{class:r,style:this.cssVars},a)}}),Q=u(`n-upload`),ln=M([T(`upload`,`width: 100%;`,[p(`dragger-inside`,[T(`upload-trigger`,`
|
||
display: block;
|
||
`)]),p(`drag-over`,[T(`upload-dragger`,`
|
||
border: var(--n-dragger-border-hover);
|
||
`)])]),T(`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);
|
||
`,[M(`&:hover`,`
|
||
border: var(--n-dragger-border-hover);
|
||
`),p(`disabled`,`
|
||
cursor: not-allowed;
|
||
`)]),T(`upload-trigger`,`
|
||
display: inline-block;
|
||
box-sizing: border-box;
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[M(`+`,[T(`upload-file-list`,`margin-top: 8px;`)]),p(`disabled`,`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`),p(`image-card`,`
|
||
width: 96px;
|
||
height: 96px;
|
||
`,[T(`base-icon`,`
|
||
font-size: 24px;
|
||
`),T(`upload-dragger`,`
|
||
padding: 0;
|
||
height: 100%;
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
`)])]),T(`upload-file-list`,`
|
||
line-height: var(--n-line-height);
|
||
opacity: 1;
|
||
transition: opacity .3s var(--n-bezier);
|
||
`,[M(`a, img`,`outline: none;`),p(`disabled`,`
|
||
opacity: var(--n-item-disabled-opacity);
|
||
cursor: not-allowed;
|
||
`,[T(`upload-file`,`cursor: not-allowed;`)]),p(`grid`,`
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, 96px);
|
||
grid-gap: 8px;
|
||
margin-top: 0;
|
||
`),T(`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);
|
||
`,[pe(),T(`progress`,[pe({foldPadding:!0})]),M(`&:hover`,`
|
||
background-color: var(--n-item-color-hover);
|
||
`,[T(`upload-file-info`,[S(`action`,`
|
||
opacity: 1;
|
||
`)])]),p(`image-type`,`
|
||
border-radius: var(--n-border-radius);
|
||
text-decoration: underline;
|
||
text-decoration-color: #0000;
|
||
`,[T(`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;
|
||
`,[T(`progress`,`
|
||
padding: 2px 0;
|
||
margin-bottom: 0;
|
||
`),S(`name`,`
|
||
padding: 0 8px;
|
||
`),S(`thumbnail`,`
|
||
width: 32px;
|
||
height: 32px;
|
||
font-size: 28px;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
`,[M(`img`,`
|
||
width: 100%;
|
||
`)])])]),p(`text-type`,[T(`progress`,`
|
||
box-sizing: border-box;
|
||
padding-bottom: 6px;
|
||
margin-bottom: 6px;
|
||
`)]),p(`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;
|
||
`,[T(`progress`,`
|
||
position: absolute;
|
||
left: 8px;
|
||
bottom: 8px;
|
||
right: 8px;
|
||
width: unset;
|
||
`),T(`upload-file-info`,`
|
||
padding: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
`,[S(`thumbnail`,`
|
||
width: 100%;
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 36px;
|
||
`,[M(`img`,`
|
||
width: 100%;
|
||
`)])]),M(`&::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: "";
|
||
`),M(`&:hover`,[M(`&::before`,`opacity: 1;`),T(`upload-file-info`,[S(`thumbnail`,`opacity: .12;`)])])]),p(`error-status`,[M(`&:hover`,`
|
||
background-color: var(--n-item-color-hover-error);
|
||
`),T(`upload-file-info`,[S(`name`,`color: var(--n-item-text-color-error);`),S(`thumbnail`,`color: var(--n-item-text-color-error);`)]),p(`image-card-type`,`
|
||
border: var(--n-item-border-image-card-error);
|
||
`)]),p(`with-url`,`
|
||
cursor: pointer;
|
||
`,[T(`upload-file-info`,[S(`name`,`
|
||
color: var(--n-item-text-color-success);
|
||
text-decoration-color: var(--n-item-text-color-success);
|
||
`,[M(`a`,`
|
||
text-decoration: underline;
|
||
`)])])]),T(`upload-file-info`,`
|
||
position: relative;
|
||
padding-top: 6px;
|
||
padding-bottom: 6px;
|
||
display: flex;
|
||
flex-wrap: nowrap;
|
||
`,[S(`thumbnail`,`
|
||
font-size: 18px;
|
||
opacity: 1;
|
||
transition: opacity .2s var(--n-bezier);
|
||
color: var(--n-item-icon-color);
|
||
`,[T(`base-icon`,`
|
||
margin-right: 2px;
|
||
vertical-align: middle;
|
||
transition: color .3s var(--n-bezier);
|
||
`)]),S(`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;
|
||
`,[T(`button`,[M(`&:not(:last-child)`,{marginRight:`4px`}),T(`base-icon`,[M(`svg`,[q()])])]),p(`image-type`,`
|
||
position: relative;
|
||
max-width: 80px;
|
||
width: auto;
|
||
`),p(`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;
|
||
`)]),S(`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);
|
||
`,[M(`a`,`
|
||
color: inherit;
|
||
text-decoration: underline;
|
||
`)])])])]),T(`upload-file-input`,`
|
||
display: none;
|
||
width: 0;
|
||
height: 0;
|
||
opacity: 0;
|
||
`)]),un=C({name:`UploadDragger`,__UPLOAD_DRAGGER__:!0,setup(e,{slots:t}){let n=a(Q,null);return n||r(`upload-dragger`,"`n-upload-dragger` must be placed inside `n-upload`."),()=>{let{mergedClsPrefixRef:{value:e},mergedDisabledRef:{value:r},maxReachedRef:{value:a}}=n;return i(`div`,{class:[`${e}-upload-dragger`,(r||a)&&`${e}-upload-dragger--disabled`]},t)}}});function dn(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},i(`g`,{fill:`none`},i(`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`})))}function fn(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 28 28`},i(`g`,{fill:`none`},i(`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 pn=C({name:`UploadProgress`,props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:a(Q).mergedThemeRef}},render(){return i(G,null,{default:()=>this.show?i(on,{type:`line`,showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),mn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function hn(e){return e.includes(`image/`)}function gn(e=``){let t=e.split(`/`),n=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(n)||[``])[0]}var _n=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,vn=e=>{if(e.type)return hn(e.type);let t=gn(e.name||``);if(_n.test(t))return!0;let n=e.thumbnailUrl||e.url||``,r=gn(n);return!!(/^data:image\//.test(n)||_n.test(r))};function yn(e){return mn(this,void 0,void 0,function*(){return yield new Promise(t=>{if(!e.type||!hn(e.type)){t(``);return}t(window.URL.createObjectURL(e))})})}var bn=L&&window.FileReader&&window.File;function xn(e){return e.isDirectory}function Sn(e){return e.isFile}function Cn(t,n){return mn(this,void 0,void 0,function*(){let r=[];function i(t){return mn(this,void 0,void 0,function*(){for(let a of t)if(a){if(n&&xn(a)){let t=a.createReader(),n=[],r;try{do r=yield new Promise((e,n)=>{t.readEntries(e,n)}),n=n.concat(r);while(r.length>0)}catch(t){e(`upload`,`error happens when handling directory upload`,t)}yield i(n)}else if(Sn(a))try{let e=yield new Promise((e,t)=>{a.file(e,t)});r.push({file:e,entry:a,source:`dnd`})}catch(t){e(`upload`,`error happens when handling file upload`,t)}}})}return yield i(t),r})}function $(e){let{id:t,name:n,percentage:r,status:i,url:a,file:o,thumbnailUrl:s,type:c,fullPath:l,batchId:u}=e;return{id:t,name:n,percentage:r??null,status:i,url:a??null,file:o??null,thumbnailUrl:s??null,type:c??null,fullPath:l??null,batchId:u??null}}function wn(e,t,n){return e=e.toLowerCase(),t=t.toLocaleLowerCase(),n=n.toLocaleLowerCase(),n.split(`,`).map(e=>e.trim()).filter(Boolean).some(n=>{if(n.startsWith(`.`)){if(e.endsWith(n))return!0}else if(n.includes(`/`)){let[e,r]=t.split(`/`),[i,a]=n.split(`/`);if((i===`*`||e&&i&&i===e)&&(a===`*`||r&&a&&a===r))return!0}else return!0;return!1})}var Tn=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},En={paddingMedium:`0 3px`,heightMedium:`24px`,iconSizeMedium:`18px`},Dn=C({name:`UploadFile`,props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0},index:{type:Number,required:!0}},setup(e){let t=a(Q),n=b(null),r=b(``),i=m(()=>{let{file:t}=e;return t.status===`finished`?`success`:t.status===`error`?`error`:`info`}),o=m(()=>{let{file:t}=e;if(t.status===`error`)return`error`}),s=m(()=>{let{file:t}=e;return t.status===`uploading`}),c=m(()=>{if(!t.showCancelButtonRef.value)return!1;let{file:n}=e;return[`uploading`,`pending`,`error`].includes(n.status)}),l=m(()=>{if(!t.showRemoveButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),u=m(()=>{if(!t.showDownloadButtonRef.value)return!1;let{file:n}=e;return[`finished`].includes(n.status)}),d=m(()=>{if(!t.showRetryButtonRef.value)return!1;let{file:n}=e;return[`error`].includes(n.status)}),f=me(()=>r.value||e.file.thumbnailUrl||e.file.url),p=m(()=>{if(!t.showPreviewButtonRef.value)return!1;let{file:{status:n},listType:r}=e;return[`finished`].includes(n)&&f.value&&r===`image-card`});function h(){return Tn(this,void 0,void 0,function*(){let n=t.onRetryRef.value;n&&(yield n({file:e.file}))===!1||t.submit({fileId:e.file.id})})}function g(t){t.preventDefault();let{file:n}=e;[`finished`,`pending`,`error`].includes(n.status)?v(n):[`uploading`].includes(n.status)?x(n):O(`upload`,`The button clicked type is unknown.`)}function _(t){t.preventDefault(),y(e.file)}function v(n){let{xhrMap:r,doChange:i,onRemoveRef:{value:a},mergedFileListRef:{value:o}}=t;Promise.resolve(a?a({file:Object.assign({},n),fileList:o,index:e.index}):!0).then(e=>{if(e===!1)return;let t=Object.assign({},n,{status:`removed`});r.delete(n.id),i(t,void 0,{remove:!0})})}function y(e){let{onDownloadRef:{value:n},customDownloadRef:{value:r}}=t;Promise.resolve(n?n(Object.assign({},e)):!0).then(t=>{t!==!1&&(r?r(Object.assign({},e)):Ce(e.url,e.name))})}function x(e){let{xhrMap:n}=t;n.get(e.id)?.abort(),v(Object.assign({},e))}function S(r){let{onPreviewRef:{value:i}}=t;if(i)i(e.file,{event:r});else if(e.listType===`image-card`){let{value:e}=n;if(!e)return;e.showPreview()}}let C=()=>Tn(this,void 0,void 0,function*(){let{listType:n}=e;n!==`image`&&n!==`image-card`||t.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield t.getFileThumbnailUrlResolver(e.file))});return A(()=>{C()}),{mergedTheme:t.mergedThemeRef,progressStatus:i,buttonType:o,showProgress:s,disabled:t.mergedDisabledRef,showCancelButton:c,showRemoveButton:l,showDownloadButton:u,showRetryButton:d,showPreviewButton:p,mergedThumbnailUrl:f,shouldUseThumbnailUrl:t.shouldUseThumbnailUrlRef,renderIcon:t.renderIconRef,imageRef:n,handleRemoveOrCancelClick:g,handleDownloadClick:_,handleRetryClick:h,handlePreviewClick:S}},render(){let{clsPrefix:e,mergedTheme:t,listType:n,file:r,renderIcon:a}=this,o,s=n===`image`;o=s||n===`image-card`?!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?i(`span`,{class:`${e}-upload-file-info__thumbnail`},a?a(r):vn(r)?i(U,{clsPrefix:e},{default:dn}):i(U,{clsPrefix:e},{default:fn})):i(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},n===`image-card`?i(Zt,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:`imageRef`}):i(`img`,{src:this.mergedThumbnailUrl||void 0,alt:r.name})):i(`span`,{class:`${e}-upload-file-info__thumbnail`},a?a(r):i(U,{clsPrefix:e},{default:()=>i(bt,null)}));let c=i(pn,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),l=n===`text`||n===`image`;return i(`div`,{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!==`error`&&n!==`image-card`&&`${e}-upload-file--with-url`,`${e}-upload-file--${n}-type`]},i(`div`,{class:`${e}-upload-file-info`},o,i(`div`,{class:`${e}-upload-file-info__name`},l&&(r.url&&r.status!==`error`?i(`a`,{rel:`noopener noreferer`,target:`_blank`,href:r.url||void 0,onClick:this.handlePreviewClick},r.name):i(`span`,{onClick:this.handlePreviewClick},r.name)),s&&c),i(`div`,{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${n}-type`]},this.showPreviewButton?i(R,{key:`preview`,quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:En},{icon:()=>i(U,{clsPrefix:e},{default:()=>i(le,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&i(R,{key:`cancelOrTrash`,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:En,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>i(ge,null,{default:()=>this.showRemoveButton?i(U,{clsPrefix:e,key:`trash`},{default:()=>i(Dt,null)}):i(U,{clsPrefix:e,key:`cancel`},{default:()=>i(xt,null)})})}),this.showRetryButton&&!this.disabled&&i(R,{key:`retry`,quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:En},{icon:()=>i(U,{clsPrefix:e},{default:()=>i(wt,null)})}),this.showDownloadButton?i(R,{key:`download`,quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,builtinThemeOverrides:En},{icon:()=>i(U,{clsPrefix:e},{default:()=>i(St,null)})}):null)),!s&&c)}}),On=C({name:`UploadTrigger`,props:{abstract:Boolean},slots:Object,setup(e,{slots:t}){let n=a(Q,null);n||r(`upload-trigger`,"`n-upload-trigger` must be placed inside `n-upload`.");let{mergedClsPrefixRef:o,mergedDisabledRef:s,maxReachedRef:c,listTypeRef:l,dragOverRef:u,openOpenFileDialog:d,draggerInsideRef:f,handleFileAddition:p,mergedDirectoryDndRef:h,triggerClassRef:g,triggerStyleRef:_}=n,v=m(()=>l.value===`image-card`);function y(){s.value||c.value||d()}function b(e){e.preventDefault(),u.value=!0}function x(e){e.preventDefault(),u.value=!0}function S(e){e.preventDefault(),u.value=!1}function C(e){if(e.preventDefault(),!f.value||s.value||c.value){u.value=!1;return}let t=e.dataTransfer?.items;t?.length?Cn(Array.from(t).map(e=>e.webkitGetAsEntry()),h.value).then(e=>{p(e)}).finally(()=>{u.value=!1}):u.value=!1}return()=>{let{value:n}=o;return e.abstract?t.default?.call(t,{handleClick:y,handleDrop:C,handleDragOver:b,handleDragEnter:x,handleDragLeave:S}):i(`div`,{class:[`${n}-upload-trigger`,(s.value||c.value)&&`${n}-upload-trigger--disabled`,v.value&&`${n}-upload-trigger--image-card`,g.value],style:_.value,onClick:y,onDrop:C,onDragover:b,onDragenter:x,onDragleave:S},v.value?i(un,null,{default:()=>z(t.default,()=>[i(U,{clsPrefix:n},{default:()=>i(ce,null)})])}):t)}}}),kn=C({name:`UploadFileList`,setup(e,{slots:t}){let n=a(Q,null);n||r(`upload-file-list`,"`n-upload-file-list` must be placed inside `n-upload`.");let{abstractRef:o,mergedClsPrefixRef:s,listTypeRef:c,mergedFileListRef:l,fileListClassRef:u,fileListStyleRef:d,cssVarsRef:f,themeClassRef:p,maxReachedRef:h,showTriggerRef:g,imageGroupPropsRef:_}=n,v=m(()=>c.value===`image-card`),y=()=>l.value.map((e,t)=>i(Dn,{clsPrefix:s.value,key:e.id,file:e,index:t,listType:c.value})),b=()=>v.value?i(Jt,Object.assign({},_.value),{default:y}):i(G,{group:!0},{default:y});return()=>{let{value:e}=s,{value:n}=o;return i(`div`,{class:[`${e}-upload-file-list`,v.value&&`${e}-upload-file-list--grid`,n?p?.value:void 0,u.value],style:[n&&f?f.value:``,d.value]},b(),g.value&&!h.value&&v.value&&i(On,null,t))}}}),An=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function jn(e,t,n){let{doChange:r,xhrMap:i}=e,a=0;function o(n){let o=Object.assign({},t,{status:`error`,percentage:a});i.delete(t.id),o=$(e.onError?.call(e,{file:o,event:n})||o),r(o,n)}function s(s){if(e.isErrorState){if(e.isErrorState(n)){o(s);return}}else if(n.status<200||n.status>=300){o(s);return}let c=Object.assign({},t,{status:`finished`,percentage:a});i.delete(t.id),c=$(e.onFinish?.call(e,{file:c,event:s})||c),r(c,s)}return{handleXHRLoad:s,handleXHRError:o,handleXHRAbort(e){let n=Object.assign({},t,{status:`removed`,file:null,percentage:a});i.delete(t.id),r(n,e)},handleXHRProgress(e){let n=Object.assign({},t,{status:`uploading`});if(e.lengthComputable){let t=Math.ceil(e.loaded/e.total*100);n.percentage=t,a=t}r(n,e)}}}function Mn(e){let{inst:t,file:n,data:r,headers:i,withCredentials:a,action:o,customRequest:s}=e,{doChange:c}=e.inst,l=0;s({file:n,data:r,headers:i,withCredentials:a,action:o,onProgress(e){let t=Object.assign({},n,{status:`uploading`}),r=e.percent;t.percentage=r,l=r,c(t)},onFinish(){let e=Object.assign({},n,{status:`finished`,percentage:l});e=$(t.onFinish?.call(t,{file:e})||e),c(e)},onError(){let e=Object.assign({},n,{status:`error`,percentage:l});e=$(t.onError?.call(t,{file:e})||e),c(e)}})}function Nn(e,t,n){let r=jn(e,t,n);n.onabort=r.handleXHRAbort,n.onerror=r.handleXHRError,n.onload=r.handleXHRLoad,n.upload&&(n.upload.onprogress=r.handleXHRProgress)}function Pn(e,t){return typeof e==`function`?e({file:t}):e||{}}function Fn(e,t,n){let r=Pn(t,n);r&&Object.keys(r).forEach(t=>{e.setRequestHeader(t,r[t])})}function In(e,t,n){let r=Pn(t,n);r&&Object.keys(r).forEach(t=>{e.append(t,r[t])})}function Ln(e,t,n,{method:r,action:i,withCredentials:a,responseType:o,headers:s,data:c}){let l=new XMLHttpRequest;l.responseType=o,e.xhrMap.set(n.id,l),l.withCredentials=a;let u=new FormData;if(In(u,c,n),n.file!==null&&u.append(t,n.file),Nn(e,n,l),i!==void 0){l.open(r.toUpperCase(),i),Fn(l,s,n),l.send(u);let t=Object.assign({},n,{status:`uploading`});e.doChange(t)}}var Rn=C({name:`Upload`,props:Object.assign(Object.assign({},D.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,onRetry:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,customDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListClass:String,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=>bn?vn(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),setup(e){e.abstract&&e.listType===`image-card`&&r(`upload`,`when the list-type is image-card, abstract is not supported.`);let{mergedClsPrefixRef:n,inlineThemeDisabled:i,mergedRtlRef:a}=s(e),c=D(`Upload`,`-upload`,ln,ve,e,n),l=v(`Upload`,a,n),u=H(e),f=b(e.defaultFileList),p=d(e,`fileList`),h=b(null),g={value:!1},_=b(!1),y=new Map,x=ie(p,f),S=m(()=>x.value.map($)),C=m(()=>{let{max:t}=e;return t===void 0?!1:S.value.length>=t});function w(){var e;(e=h.value)==null||e.click()}function T(e){let t=e.target;j(t.files?Array.from(t.files).map(e=>({file:e,entry:null,source:`input`})):null,e),t.value=``}function E(t){let{"onUpdate:fileList":n,onUpdateFileList:r}=e;n&&B(n,t),r&&B(r,t),f.value=t}let O=m(()=>e.multiple||e.directory),A=(t,n,r={append:!1,remove:!1})=>{let{append:i,remove:a}=r,o=Array.from(S.value),s=o.findIndex(e=>e.id===t.id);if(i||a||~s){i?o.push(t):a?o.splice(s,1):o.splice(s,1,t);let{onChange:r}=e;r&&r({file:t,fileList:o,event:n}),E(o)}};function j(t,n){if(!t||t.length===0)return;let{onBeforeUpload:r}=e;t=O.value?t:[t[0]];let{max:i,accept:a}=e;t=t.filter(({file:e,source:t})=>t===`dnd`&&a?.trim()?wn(e.name,e.type,a):!0),i&&(t=t.slice(0,i-S.value.length));let s=de();Promise.all(t.map(e=>An(this,[e],void 0,function*({file:e,entry:t}){let n={id:de(),batchId:s,name:e.name,status:`pending`,percentage:0,file:e,url:null,type:e.type,thumbnailUrl:null,fullPath:t?.fullPath??`/${e.webkitRelativePath||e.name}`};return!r||(yield r({file:n,fileList:S.value}))!==!1?n:null}))).then(e=>An(this,void 0,void 0,function*(){let t=Promise.resolve();e.forEach(e=>{t=t.then(o).then(()=>{e&&A(e,n,{append:!0})})}),yield t})).then(()=>{e.defaultUpload&&M()})}function M({fileId:t,retry:n=!1}={}){let{method:r,action:i,withCredentials:a,headers:o,data:s,name:c}=e,l=t===void 0?S.value:S.value.filter(e=>e.id===t),u=n||t!==void 0;l.forEach(t=>{let{status:n}=t;(n===`pending`||n===`error`&&u)&&(e.customRequest?Mn({inst:{doChange:A,xhrMap:y,onFinish:e.onFinish,onError:e.onError},file:t,action:i,withCredentials:a,headers:o,data:s,customRequest:e.customRequest}):Ln({doChange:A,xhrMap:y,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},c,t,{method:r,action:i,withCredentials:a,responseType:e.responseType,headers:o,data:s}))})}function ee(t){if(t.thumbnailUrl)return t.thumbnailUrl;let{createThumbnailUrl:n}=e;return n?n(t.file,t)??(t.url||``):t.url?t.url:t.file?yn(t.file):``}let N=m(()=>{let{common:{cubicBezierEaseInOut:e},self:{draggerColor:t,draggerBorder:n,draggerBorderHover:r,itemColorHover:i,itemColorHoverError:a,itemTextColorError:o,itemTextColorSuccess:s,itemTextColor:l,itemIconColor:u,itemDisabledOpacity:d,lineHeight:f,borderRadius:p,fontSize:m,itemBorderImageCardError:h,itemBorderImageCard:g}}=c.value;return{"--n-bezier":e,"--n-border-radius":p,"--n-dragger-border":n,"--n-dragger-border-hover":r,"--n-dragger-color":t,"--n-font-size":m,"--n-item-color-hover":i,"--n-item-color-hover-error":a,"--n-item-disabled-opacity":d,"--n-item-icon-color":u,"--n-item-text-color":l,"--n-item-text-color-error":o,"--n-item-text-color-success":s,"--n-line-height":f,"--n-item-border-image-card-error":h,"--n-item-border-image-card":g}}),P=i?t(`upload`,void 0,N,e):void 0;k(Q,{mergedClsPrefixRef:n,mergedThemeRef:c,showCancelButtonRef:d(e,`showCancelButton`),showDownloadButtonRef:d(e,`showDownloadButton`),showRemoveButtonRef:d(e,`showRemoveButton`),showRetryButtonRef:d(e,`showRetryButton`),onRemoveRef:d(e,`onRemove`),onDownloadRef:d(e,`onDownload`),customDownloadRef:d(e,`customDownload`),mergedFileListRef:S,triggerClassRef:d(e,`triggerClass`),triggerStyleRef:d(e,`triggerStyle`),shouldUseThumbnailUrlRef:d(e,`shouldUseThumbnailUrl`),renderIconRef:d(e,`renderIcon`),xhrMap:y,submit:M,doChange:A,showPreviewButtonRef:d(e,`showPreviewButton`),onPreviewRef:d(e,`onPreview`),getFileThumbnailUrlResolver:ee,listTypeRef:d(e,`listType`),dragOverRef:_,openOpenFileDialog:w,draggerInsideRef:g,handleFileAddition:j,mergedDisabledRef:u.mergedDisabledRef,maxReachedRef:C,fileListClassRef:d(e,`fileListClass`),fileListStyleRef:d(e,`fileListStyle`),abstractRef:d(e,`abstract`),acceptRef:d(e,`accept`),cssVarsRef:i?void 0:N,themeClassRef:P?.themeClass,onRender:P?.onRender,showTriggerRef:d(e,`showTrigger`),imageGroupPropsRef:d(e,`imageGroupProps`),mergedDirectoryDndRef:m(()=>e.directoryDnd??e.directory),onRetryRef:d(e,`onRetry`)});let F={clear:()=>{f.value=[]},submit:M,openOpenFileDialog:w};return Object.assign({mergedClsPrefix:n,draggerInsideRef:g,rtlEnabled:l,inputElRef:h,mergedTheme:c,dragOver:_,mergedMultiple:O,cssVars:i?void 0:N,themeClass:P?.themeClass,onRender:P?.onRender,handleFileInputChange:T},F)},render(){let{draggerInsideRef:e,mergedClsPrefix:t,$slots:n,directory:r,onRender:a}=this;n.default&&!this.abstract&&n.default()[0]?.type?.__UPLOAD_DRAGGER__&&(e.value=!0);let o=i(`input`,Object.assign({},this.inputProps,{ref:`inputElRef`,type:`file`,class:`${t}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:r||void 0,directory:r||void 0}));return this.abstract?i(x,null,n.default?.call(n),i(y,{to:`body`},o)):(a?.(),i(`div`,{class:[`${t}-upload`,this.rtlEnabled&&`${t}-upload--rtl`,e.value&&`${t}-upload--dragger-inside`,this.dragOver&&`${t}-upload--drag-over`,this.themeClass],style:this.cssVars},o,this.showTrigger&&this.listType!==`image-card`&&i(On,null,n),this.showFileList&&i(kn,null,n)))}});export{un as n,cn as r,Rn as t}; |