vue-devui 1.0.0-alpha.6 → 1.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/README.md +32 -35
  2. package/accordion/index.d.ts +7 -0
  3. package/accordion/index.es.js +508 -1
  4. package/accordion/index.umd.js +1 -1
  5. package/accordion/style.css +1 -1
  6. package/alert/index.d.ts +7 -0
  7. package/alert/index.es.js +178 -1
  8. package/alert/index.umd.js +1 -1
  9. package/alert/style.css +1 -1
  10. package/anchor/index.d.ts +7 -0
  11. package/anchor/index.es.js +263 -1
  12. package/anchor/index.umd.js +1 -1
  13. package/avatar/index.d.ts +7 -0
  14. package/avatar/index.es.js +301 -1
  15. package/avatar/index.umd.js +1 -1
  16. package/back-top/index.d.ts +7 -0
  17. package/back-top/index.es.js +128 -0
  18. package/back-top/index.umd.js +1 -0
  19. package/back-top/package.json +7 -0
  20. package/back-top/style.css +1 -0
  21. package/badge/index.d.ts +7 -0
  22. package/badge/index.es.js +95 -1
  23. package/badge/index.umd.js +1 -1
  24. package/breadcrumb/index.d.ts +7 -0
  25. package/breadcrumb/index.es.js +127 -1
  26. package/breadcrumb/index.umd.js +1 -1
  27. package/button/index.d.ts +7 -0
  28. package/button/index.es.js +392 -1
  29. package/button/index.umd.js +1 -1
  30. package/button/style.css +1 -1
  31. package/card/index.d.ts +7 -0
  32. package/card/index.es.js +61 -1
  33. package/card/index.umd.js +1 -1
  34. package/carousel/index.d.ts +7 -0
  35. package/carousel/index.es.js +329 -1
  36. package/carousel/index.umd.js +1 -1
  37. package/cascader/index.d.ts +7 -0
  38. package/cascader/index.es.js +1343 -1
  39. package/cascader/index.umd.js +1 -1
  40. package/cascader/style.css +1 -1
  41. package/checkbox/index.d.ts +7 -0
  42. package/checkbox/index.es.js +377 -1
  43. package/checkbox/index.umd.js +1 -1
  44. package/comment/index.d.ts +7 -0
  45. package/comment/index.es.js +85 -0
  46. package/comment/index.umd.js +1 -0
  47. package/comment/package.json +7 -0
  48. package/comment/style.css +1 -0
  49. package/countdown/index.d.ts +7 -0
  50. package/countdown/index.es.js +176 -0
  51. package/countdown/index.umd.js +1 -0
  52. package/countdown/package.json +7 -0
  53. package/countdown/style.css +1 -0
  54. package/date-picker/index.d.ts +7 -0
  55. package/date-picker/index.es.js +1172 -1
  56. package/date-picker/index.umd.js +1 -1
  57. package/date-picker/style.css +1 -1
  58. package/dragdrop/index.d.ts +7 -0
  59. package/dragdrop/index.es.js +32 -0
  60. package/dragdrop/index.umd.js +1 -0
  61. package/dragdrop/package.json +7 -0
  62. package/drawer/index.d.ts +7 -0
  63. package/drawer/index.es.js +287 -0
  64. package/drawer/index.umd.js +1 -0
  65. package/drawer/package.json +7 -0
  66. package/drawer/style.css +1 -0
  67. package/dropdown/index.d.ts +7 -0
  68. package/dropdown/index.es.js +535 -0
  69. package/dropdown/index.umd.js +1 -0
  70. package/dropdown/package.json +7 -0
  71. package/dropdown/style.css +1 -0
  72. package/editable-select/index.d.ts +7 -0
  73. package/editable-select/index.es.js +5857 -1
  74. package/editable-select/index.umd.js +27 -1
  75. package/editable-select/style.css +1 -1
  76. package/form/index.d.ts +7 -0
  77. package/form/index.es.js +2244 -0
  78. package/form/index.umd.js +1 -0
  79. package/form/package.json +7 -0
  80. package/form/style.css +1 -0
  81. package/fullscreen/index.d.ts +7 -0
  82. package/fullscreen/index.es.js +163 -1
  83. package/fullscreen/index.umd.js +1 -1
  84. package/gantt/index.d.ts +7 -0
  85. package/gantt/index.es.js +535 -0
  86. package/gantt/index.umd.js +1 -0
  87. package/gantt/package.json +7 -0
  88. package/gantt/style.css +1 -0
  89. package/grid/index.d.ts +7 -0
  90. package/grid/index.es.js +269 -0
  91. package/grid/index.umd.js +1 -0
  92. package/grid/package.json +7 -0
  93. package/grid/style.css +1 -0
  94. package/icon/index.d.ts +7 -0
  95. package/icon/index.es.js +75 -1
  96. package/icon/index.umd.js +1 -1
  97. package/image-preview/index.d.ts +7 -0
  98. package/image-preview/index.es.js +498 -1
  99. package/image-preview/index.umd.js +1 -1
  100. package/image-preview/style.css +1 -1
  101. package/index.d.ts +7 -0
  102. package/input/index.d.ts +7 -0
  103. package/input/index.es.js +190 -1
  104. package/input/index.umd.js +1 -1
  105. package/input-icon/index.d.ts +7 -0
  106. package/input-icon/index.es.js +332 -0
  107. package/input-icon/index.umd.js +1 -0
  108. package/input-icon/package.json +7 -0
  109. package/input-icon/style.css +1 -0
  110. package/input-number/index.d.ts +7 -0
  111. package/input-number/index.es.js +240 -1
  112. package/input-number/index.umd.js +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +100 -0
  115. package/layout/index.umd.js +1 -0
  116. package/layout/package.json +7 -0
  117. package/layout/style.css +1 -0
  118. package/loading/index.d.ts +7 -0
  119. package/loading/index.es.js +256 -1
  120. package/loading/index.umd.js +1 -1
  121. package/modal/index.d.ts +7 -0
  122. package/modal/index.es.js +1225 -1
  123. package/modal/index.umd.js +1 -1
  124. package/modal/style.css +1 -1
  125. package/nav-sprite/index.d.ts +7 -0
  126. package/nav-sprite/index.es.js +742 -0
  127. package/nav-sprite/index.umd.js +1 -0
  128. package/nav-sprite/package.json +7 -0
  129. package/nuxt/components/Accordion.js +3 -0
  130. package/nuxt/components/Alert.js +3 -0
  131. package/nuxt/components/Anchor.js +3 -0
  132. package/nuxt/components/Aside.js +3 -0
  133. package/nuxt/components/Avatar.js +3 -0
  134. package/nuxt/components/BackTop.js +3 -0
  135. package/nuxt/components/Badge.js +3 -0
  136. package/nuxt/components/Breadcrumb.js +3 -0
  137. package/nuxt/components/Button.js +3 -0
  138. package/nuxt/components/Card.js +3 -0
  139. package/nuxt/components/Carousel.js +3 -0
  140. package/nuxt/components/Cascader.js +3 -0
  141. package/nuxt/components/Checkbox.js +3 -0
  142. package/nuxt/components/Col.js +3 -0
  143. package/nuxt/components/Column.js +3 -0
  144. package/nuxt/components/Comment.js +3 -0
  145. package/nuxt/components/Content.js +3 -0
  146. package/nuxt/components/Countdown.js +3 -0
  147. package/nuxt/components/DatePicker.js +3 -0
  148. package/nuxt/components/Drawer.js +3 -0
  149. package/nuxt/components/Dropdown.js +3 -0
  150. package/nuxt/components/EditableSelect.js +3 -0
  151. package/nuxt/components/FixedOverlay.js +3 -0
  152. package/nuxt/components/FlexibleOverlay.js +3 -0
  153. package/nuxt/components/Footer.js +3 -0
  154. package/nuxt/components/Form.js +3 -0
  155. package/nuxt/components/FormControl.js +3 -0
  156. package/nuxt/components/FormItem.js +3 -0
  157. package/nuxt/components/FormLabel.js +3 -0
  158. package/nuxt/components/FormOperation.js +3 -0
  159. package/nuxt/components/Fullscreen.js +3 -0
  160. package/nuxt/components/Gantt.js +3 -0
  161. package/nuxt/components/Header.js +3 -0
  162. package/nuxt/components/Icon.js +2 -0
  163. package/nuxt/components/ImagePreviewService.js +3 -0
  164. package/nuxt/components/Input.js +3 -0
  165. package/nuxt/components/InputIcon.js +3 -0
  166. package/nuxt/components/InputNumber.js +3 -0
  167. package/nuxt/components/Layout.js +3 -0
  168. package/nuxt/components/Loading.js +3 -0
  169. package/nuxt/components/LoadingService.js +3 -0
  170. package/nuxt/components/Modal.js +3 -0
  171. package/nuxt/components/NavSprite.js +2 -0
  172. package/nuxt/components/Pagination.js +3 -0
  173. package/nuxt/components/Panel.js +3 -0
  174. package/nuxt/components/Popover.js +3 -0
  175. package/nuxt/components/Progress.js +3 -0
  176. package/nuxt/components/QuadrantDiagram.js +3 -0
  177. package/nuxt/components/Radio.js +3 -0
  178. package/nuxt/components/RadioGroup.js +3 -0
  179. package/nuxt/components/Rate.js +3 -0
  180. package/nuxt/components/ReadTip.js +3 -0
  181. package/nuxt/components/Result.js +3 -0
  182. package/nuxt/components/Row.js +3 -0
  183. package/nuxt/components/Search.js +3 -0
  184. package/nuxt/components/Select.js +3 -0
  185. package/nuxt/components/Skeleton.js +3 -0
  186. package/nuxt/components/SkeletonItem.js +3 -0
  187. package/nuxt/components/Slider.js +3 -0
  188. package/nuxt/components/Splitter.js +3 -0
  189. package/nuxt/components/Statistic.js +3 -0
  190. package/nuxt/components/Status.js +3 -0
  191. package/nuxt/components/StepsGuide.js +3 -0
  192. package/nuxt/components/StickSlider.js +3 -0
  193. package/nuxt/components/Sticky.js +2 -0
  194. package/nuxt/components/Switch.js +3 -0
  195. package/nuxt/components/Table.js +3 -0
  196. package/nuxt/components/Tabs.js +3 -0
  197. package/nuxt/components/Tag.js +3 -0
  198. package/nuxt/components/TagInput.js +3 -0
  199. package/nuxt/components/Textarea.js +3 -0
  200. package/nuxt/components/TimeAxis.js +3 -0
  201. package/nuxt/components/TimeAxisItem.js +3 -0
  202. package/nuxt/components/TimePicker.js +3 -0
  203. package/nuxt/components/Toast.js +3 -0
  204. package/nuxt/components/ToastService.js +3 -0
  205. package/nuxt/components/Tooltip.js +3 -0
  206. package/nuxt/components/Transfer.js +3 -0
  207. package/nuxt/components/Tree.js +3 -0
  208. package/nuxt/components/TreeSelect.js +3 -0
  209. package/nuxt/components/Upload.js +3 -0
  210. package/nuxt/components/buttonProps.js +3 -0
  211. package/nuxt/index.js +13 -0
  212. package/overlay/index.d.ts +7 -0
  213. package/overlay/index.es.js +368 -1
  214. package/overlay/index.umd.js +1 -1
  215. package/overlay/style.css +1 -1
  216. package/package.json +6 -47
  217. package/pagination/index.d.ts +7 -0
  218. package/pagination/index.es.js +642 -1
  219. package/pagination/index.umd.js +1 -1
  220. package/panel/index.d.ts +7 -0
  221. package/panel/index.es.js +205 -1
  222. package/panel/index.umd.js +1 -1
  223. package/panel/style.css +1 -1
  224. package/popover/index.d.ts +7 -0
  225. package/popover/index.es.js +236 -1
  226. package/popover/index.umd.js +1 -1
  227. package/progress/index.d.ts +7 -0
  228. package/progress/index.es.js +153 -1
  229. package/progress/index.umd.js +3 -1
  230. package/quadrant-diagram/index.d.ts +7 -0
  231. package/quadrant-diagram/index.es.js +489 -1
  232. package/quadrant-diagram/index.umd.js +1 -1
  233. package/radio/index.d.ts +7 -0
  234. package/radio/index.es.js +225 -1
  235. package/radio/index.umd.js +1 -1
  236. package/rate/index.d.ts +7 -0
  237. package/rate/index.es.js +220 -1
  238. package/rate/index.umd.js +1 -1
  239. package/read-tip/index.d.ts +7 -0
  240. package/read-tip/index.es.js +258 -0
  241. package/read-tip/index.umd.js +1 -0
  242. package/read-tip/package.json +7 -0
  243. package/read-tip/style.css +1 -0
  244. package/result/index.d.ts +7 -0
  245. package/result/index.es.js +119 -0
  246. package/result/index.umd.js +1 -0
  247. package/result/package.json +7 -0
  248. package/result/style.css +1 -0
  249. package/ripple/index.d.ts +7 -0
  250. package/ripple/index.es.js +181 -1
  251. package/ripple/index.umd.js +1 -1
  252. package/search/index.d.ts +7 -0
  253. package/search/index.es.js +543 -1
  254. package/search/index.umd.js +1 -1
  255. package/select/index.d.ts +7 -0
  256. package/select/index.es.js +706 -1
  257. package/select/index.umd.js +1 -1
  258. package/skeleton/index.d.ts +7 -0
  259. package/skeleton/index.es.js +297 -1
  260. package/skeleton/index.umd.js +1 -1
  261. package/skeleton/style.css +1 -1
  262. package/slider/index.d.ts +7 -0
  263. package/slider/index.es.js +199 -1
  264. package/slider/index.umd.js +1 -1
  265. package/slider/style.css +1 -1
  266. package/splitter/index.d.ts +7 -0
  267. package/splitter/index.es.js +636 -1
  268. package/splitter/index.umd.js +1 -1
  269. package/statistic/index.d.ts +7 -0
  270. package/statistic/index.es.js +280 -0
  271. package/statistic/index.umd.js +1 -0
  272. package/statistic/package.json +7 -0
  273. package/statistic/style.css +1 -0
  274. package/status/index.d.ts +7 -0
  275. package/status/index.es.js +42 -1
  276. package/status/index.umd.js +1 -1
  277. package/steps-guide/index.d.ts +7 -0
  278. package/steps-guide/index.es.js +239 -1
  279. package/steps-guide/index.umd.js +1 -1
  280. package/steps-guide/style.css +1 -1
  281. package/sticky/index.d.ts +7 -0
  282. package/sticky/index.es.js +197 -1
  283. package/sticky/index.umd.js +1 -1
  284. package/style.css +1 -1
  285. package/switch/index.d.ts +7 -0
  286. package/switch/index.es.js +100 -1
  287. package/switch/index.umd.js +1 -1
  288. package/switch/style.css +1 -1
  289. package/table/index.d.ts +7 -0
  290. package/table/index.es.js +1836 -1
  291. package/table/index.umd.js +1 -1
  292. package/table/style.css +1 -1
  293. package/tabs/index.d.ts +7 -0
  294. package/tabs/index.es.js +195 -1
  295. package/tabs/index.umd.js +1 -1
  296. package/tabs/style.css +1 -1
  297. package/tag/index.d.ts +7 -0
  298. package/tag/index.es.js +131 -0
  299. package/tag/index.umd.js +1 -0
  300. package/tag/package.json +7 -0
  301. package/tag/style.css +1 -0
  302. package/tag-input/index.d.ts +7 -0
  303. package/tag-input/index.es.js +329 -1
  304. package/tag-input/index.umd.js +1 -1
  305. package/textarea/index.d.ts +7 -0
  306. package/textarea/index.es.js +132 -0
  307. package/textarea/index.umd.js +1 -0
  308. package/textarea/package.json +7 -0
  309. package/textarea/style.css +1 -0
  310. package/time-axis/index.d.ts +7 -0
  311. package/time-axis/index.es.js +299 -0
  312. package/time-axis/index.umd.js +1 -0
  313. package/time-axis/package.json +7 -0
  314. package/time-axis/style.css +1 -0
  315. package/time-picker/index.d.ts +7 -0
  316. package/time-picker/index.es.js +1260 -1
  317. package/time-picker/index.umd.js +1 -1
  318. package/time-picker/style.css +1 -1
  319. package/toast/index.d.ts +7 -0
  320. package/toast/index.es.js +2060 -1
  321. package/toast/index.umd.js +1 -1
  322. package/toast/style.css +1 -1
  323. package/tooltip/index.d.ts +7 -0
  324. package/tooltip/index.es.js +171 -1
  325. package/tooltip/index.umd.js +1 -1
  326. package/transfer/index.d.ts +7 -0
  327. package/transfer/index.es.js +1725 -1
  328. package/transfer/index.umd.js +1 -1
  329. package/transfer/style.css +1 -1
  330. package/tree/index.d.ts +7 -0
  331. package/tree/index.es.js +907 -1
  332. package/tree/index.umd.js +1 -1
  333. package/tree/style.css +1 -1
  334. package/tree-select/index.d.ts +7 -0
  335. package/tree-select/index.es.js +528 -0
  336. package/tree-select/index.umd.js +1 -0
  337. package/tree-select/package.json +7 -0
  338. package/tree-select/style.css +1 -0
  339. package/upload/index.d.ts +7 -0
  340. package/upload/index.es.js +2834 -1
  341. package/upload/index.umd.js +1 -1
  342. package/upload/style.css +1 -1
  343. package/vue-devui.es.js +27777 -1
  344. package/vue-devui.umd.js +29 -1
@@ -1 +1,2834 @@
1
- var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,l=(e,t)=>{for(var n in t||(t={}))o.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},u=("undefined"!=typeof require&&require,(e,t,n)=>(a(e,"symbol"!=typeof t?t+"":t,n),n));import{defineComponent as s,createVNode as c,getCurrentInstance as d,ref as p,computed as f,watch as v,nextTick as h,onUnmounted as y,mergeProps as b,createApp as m,toRefs as g,withDirectives as j,resolveComponent as _,createTextVNode as O,resolveDirective as F,Fragment as w,isVNode as x}from"vue";const T={value:{type:Array,required:!0,default:()=>[]},life:{type:Number,default:null},lifeMode:{type:String,default:"global"},sticky:{type:Boolean,default:!1},style:{type:Object,default:()=>({})},styleClass:{type:String},onCloseEvent:{type:Function},onValueChange:{type:Function}};var A=s({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup:e=>l({},e),render(){const{name:e,size:t,color:n,classPrefix:r}=this;return c("i",{class:`${r} ${r}-${e}`,style:{fontSize:t,color:n}},null)}});A.install=function(e){e.component(A.name,A)};var E=s({name:"DToastIconClose",props:{prefixCls:String,onClick:Function},emits:["click"],render(){const{prefixCls:e,$emit:t}=this;return c("div",{class:`${e}-icon-close`,onClick:e=>t("click",e)},[c(A,{name:"close",size:"14px"},null)])}}),S=s({name:"DToastImage",props:{prefixCls:String,severity:String},render(){const{prefixCls:e,severity:t}=this;return c("span",{class:[`${e}-image`,`${e}-image-${t||"common"}`]},["common"!==t?c(A,{name:{info:"info-o",success:"right-o",warn:"warning-o",error:"error-o"}[t],size:"14px"},null):null])}}),D="object"==typeof global&&global&&global.Object===Object&&global,U="object"==typeof self&&self&&self.Object===Object&&self,k=D||U||Function("return this")(),C=k.Symbol,M=Object.prototype,$=M.hasOwnProperty,I=M.toString,P=C?C.toStringTag:void 0;var z=Object.prototype.toString;var B=C?C.toStringTag:void 0;function N(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=$.call(e,P),n=e[P];try{e[P]=void 0;var r=!0}catch(i){}var o=I.call(e);return r&&(t?e[P]=n:delete e[P]),o}(e):function(e){return z.call(e)}(e)}function L(e){return null!=e&&"object"==typeof e}function R(e){return"symbol"==typeof e||L(e)&&"[object Symbol]"==N(e)}function V(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var q=Array.isArray,W=C?C.prototype:void 0,H=W?W.toString:void 0;function X(e){if("string"==typeof e)return e;if(q(e))return V(e,X)+"";if(R(e))return H?H.call(e):"";var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}var G=/\s/;var J=/^\s+/;function K(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}(e)+1).replace(J,""):e}function Q(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Y=/^[-+]0x[0-9a-f]+$/i,Z=/^0b[01]+$/i,ee=/^0o[0-7]+$/i,te=parseInt;function ne(e){if("number"==typeof e)return e;if(R(e))return NaN;if(Q(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Q(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=K(e);var n=Z.test(e);return n||ee.test(e)?te(e.slice(2),n?2:8):Y.test(e)?NaN:+e}function re(e){return e}function oe(e){if(!Q(e))return!1;var t=N(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var ie,ae=k["__core-js_shared__"],le=(ie=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||""))?"Symbol(src)_1."+ie:"";var ue=Function.prototype.toString;function se(e){if(null!=e){try{return ue.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var ce=/^\[object .+?Constructor\]$/,de=Function.prototype,pe=Object.prototype,fe=de.toString,ve=pe.hasOwnProperty,he=RegExp("^"+fe.call(ve).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ye(e){return!(!Q(e)||(t=e,le&&le in t))&&(oe(e)?he:ce).test(se(e));var t}function be(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(n)?n:void 0}var me=be(k,"WeakMap"),ge=Object.create,je=function(){function e(){}return function(t){if(!Q(t))return{};if(ge)return ge(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function _e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Oe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Fe=Date.now;var we,xe,Te,Ae=function(){try{var e=be(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ee=(we=Ae?function(e,t){return Ae(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:re,xe=0,Te=0,function(){var e=Fe(),t=16-(e-Te);if(Te=e,t>0){if(++xe>=800)return arguments[0]}else xe=0;return we.apply(void 0,arguments)});var Se=/^(?:0|[1-9]\d*)$/;function De(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Se.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e,t,n){"__proto__"==t&&Ae?Ae(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ke(e,t){return e===t||e!=e&&t!=t}var Ce=Object.prototype.hasOwnProperty;function Me(e,t,n){var r=e[t];Ce.call(e,t)&&ke(r,n)&&(void 0!==n||t in e)||Ue(e,t,n)}function $e(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var l=t[i],u=r?r(n[l],e[l],l,n,e):void 0;void 0===u&&(u=e[l]),o?Ue(n,l,u):Me(n,l,u)}return n}var Ie=Math.max;function Pe(e,t,n){return t=Ie(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Ie(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),_e(e,this,l)}}function ze(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Be(e){return null!=e&&ze(e.length)&&!oe(e)}var Ne=Object.prototype;function Le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ne)}function Re(e){return L(e)&&"[object Arguments]"==N(e)}var Ve=Object.prototype,qe=Ve.hasOwnProperty,We=Ve.propertyIsEnumerable,He=Re(function(){return arguments}())?Re:function(e){return L(e)&&qe.call(e,"callee")&&!We.call(e,"callee")};var Xe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ge=Xe&&"object"==typeof module&&module&&!module.nodeType&&module,Je=Ge&&Ge.exports===Xe?k.Buffer:void 0,Ke=(Je?Je.isBuffer:void 0)||function(){return!1},Qe={};function Ye(e){return function(t){return e(t)}}Qe["[object Float32Array]"]=Qe["[object Float64Array]"]=Qe["[object Int8Array]"]=Qe["[object Int16Array]"]=Qe["[object Int32Array]"]=Qe["[object Uint8Array]"]=Qe["[object Uint8ClampedArray]"]=Qe["[object Uint16Array]"]=Qe["[object Uint32Array]"]=!0,Qe["[object Arguments]"]=Qe["[object Array]"]=Qe["[object ArrayBuffer]"]=Qe["[object Boolean]"]=Qe["[object DataView]"]=Qe["[object Date]"]=Qe["[object Error]"]=Qe["[object Function]"]=Qe["[object Map]"]=Qe["[object Number]"]=Qe["[object Object]"]=Qe["[object RegExp]"]=Qe["[object Set]"]=Qe["[object String]"]=Qe["[object WeakMap]"]=!1;var Ze="object"==typeof exports&&exports&&!exports.nodeType&&exports,et=Ze&&"object"==typeof module&&module&&!module.nodeType&&module,tt=et&&et.exports===Ze&&D.process,nt=function(){try{var e=et&&et.require&&et.require("util").types;return e||tt&&tt.binding&&tt.binding("util")}catch(t){}}(),rt=nt&&nt.isTypedArray,ot=rt?Ye(rt):function(e){return L(e)&&ze(e.length)&&!!Qe[N(e)]},it=Object.prototype.hasOwnProperty;function at(e,t){var n=q(e),r=!n&&He(e),o=!n&&!r&&Ke(e),i=!n&&!r&&!o&&ot(e),a=n||r||o||i,l=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],u=l.length;for(var s in e)!t&&!it.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||De(s,u))||l.push(s);return l}function lt(e,t){return function(n){return e(t(n))}}var ut=lt(Object.keys,Object),st=Object.prototype.hasOwnProperty;function ct(e){return Be(e)?at(e):function(e){if(!Le(e))return ut(e);var t=[];for(var n in Object(e))st.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var dt=Object.prototype.hasOwnProperty;function pt(e){if(!Q(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Le(e),n=[];for(var r in e)("constructor"!=r||!t&&dt.call(e,r))&&n.push(r);return n}function ft(e){return Be(e)?at(e,!0):pt(e)}var vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ht=/^\w*$/;var yt=be(Object,"create");var bt=Object.prototype.hasOwnProperty;var mt=Object.prototype.hasOwnProperty;function gt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function jt(e,t){for(var n=e.length;n--;)if(ke(e[n][0],t))return n;return-1}gt.prototype.clear=function(){this.__data__=yt?yt(null):{},this.size=0},gt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},gt.prototype.get=function(e){var t=this.__data__;if(yt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return bt.call(t,e)?t[e]:void 0},gt.prototype.has=function(e){var t=this.__data__;return yt?void 0!==t[e]:mt.call(t,e)},gt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yt&&void 0===t?"__lodash_hash_undefined__":t,this};var _t=Array.prototype.splice;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ot.prototype.clear=function(){this.__data__=[],this.size=0},Ot.prototype.delete=function(e){var t=this.__data__,n=jt(t,e);return!(n<0)&&(n==t.length-1?t.pop():_t.call(t,n,1),--this.size,!0)},Ot.prototype.get=function(e){var t=this.__data__,n=jt(t,e);return n<0?void 0:t[n][1]},Ot.prototype.has=function(e){return jt(this.__data__,e)>-1},Ot.prototype.set=function(e,t){var n=this.__data__,r=jt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ft=be(k,"Map");function wt(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xt.prototype.clear=function(){this.size=0,this.__data__={hash:new gt,map:new(Ft||Ot),string:new gt}},xt.prototype.delete=function(e){var t=wt(this,e).delete(e);return this.size-=t?1:0,t},xt.prototype.get=function(e){return wt(this,e).get(e)},xt.prototype.has=function(e){return wt(this,e).has(e)},xt.prototype.set=function(e,t){var n=wt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Tt(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Tt.Cache||xt),n}Tt.Cache=xt;var At=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Et=/\\(\\)?/g,St=function(e){var t=Tt(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(At,(function(e,n,r,o){t.push(r?o.replace(Et,"$1"):n||e)})),t}));function Dt(e,t){return q(e)?e:function(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!R(e))||ht.test(e)||!vt.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:St(function(e){return null==e?"":X(e)}(e))}function Ut(e){if("string"==typeof e||R(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}function kt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Ct=C?C.isConcatSpreadable:void 0;function Mt(e){return q(e)||He(e)||!!(Ct&&e&&e[Ct])}function $t(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=Mt),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?$t(l,t-1,n,r,o):kt(o,l):r||(o[o.length]=l)}return o}function It(e){return(null==e?0:e.length)?$t(e,1):[]}var Pt=lt(Object.getPrototypeOf,Object),zt=Function.prototype,Bt=Object.prototype,Nt=zt.toString,Lt=Bt.hasOwnProperty,Rt=Nt.call(Object);function Vt(e){if(!L(e)||"[object Object]"!=N(e))return!1;var t=Pt(e);if(null===t)return!0;var n=Lt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Nt.call(n)==Rt}function qt(e){var t=this.__data__=new Ot(e);this.size=t.size}qt.prototype.clear=function(){this.__data__=new Ot,this.size=0},qt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},qt.prototype.get=function(e){return this.__data__.get(e)},qt.prototype.has=function(e){return this.__data__.has(e)},qt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!Ft||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new xt(r)}return n.set(e,t),this.size=n.size,this};var Wt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ht=Wt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Ht&&Ht.exports===Wt?k.Buffer:void 0,Gt=Xt?Xt.allocUnsafe:void 0;function Jt(e,t){if(t)return e.slice();var n=e.length,r=Gt?Gt(n):new e.constructor(n);return e.copy(r),r}function Kt(){return[]}var Qt=Object.prototype.propertyIsEnumerable,Yt=Object.getOwnPropertySymbols,Zt=Yt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(Yt(e),(function(t){return Qt.call(e,t)})))}:Kt;var en=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)kt(t,Zt(e)),e=Pt(e);return t}:Kt;function tn(e,t,n){var r=t(e);return q(e)?r:kt(r,n(e))}function nn(e){return tn(e,ct,Zt)}function rn(e){return tn(e,ft,en)}var on=be(k,"DataView"),an=be(k,"Promise"),ln=be(k,"Set"),un=se(on),sn=se(Ft),cn=se(an),dn=se(ln),pn=se(me),fn=N;(on&&"[object DataView]"!=fn(new on(new ArrayBuffer(1)))||Ft&&"[object Map]"!=fn(new Ft)||an&&"[object Promise]"!=fn(an.resolve())||ln&&"[object Set]"!=fn(new ln)||me&&"[object WeakMap]"!=fn(new me))&&(fn=function(e){var t=N(e),n="[object Object]"==t?e.constructor:void 0,r=n?se(n):"";if(r)switch(r){case un:return"[object DataView]";case sn:return"[object Map]";case cn:return"[object Promise]";case dn:return"[object Set]";case pn:return"[object WeakMap]"}return t});var vn=fn,hn=Object.prototype.hasOwnProperty;var yn=k.Uint8Array;function bn(e){var t=new e.constructor(e.byteLength);return new yn(t).set(new yn(e)),t}var mn=/\w*$/;var gn=C?C.prototype:void 0,jn=gn?gn.valueOf:void 0;function _n(e,t){var n=t?bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function On(e,t,n){var r,o,i,a=e.constructor;switch(t){case"[object ArrayBuffer]":return bn(e);case"[object Boolean]":case"[object Date]":return new a(+e);case"[object DataView]":return function(e,t){var n=t?bn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return _n(e,n);case"[object Map]":return new a;case"[object Number]":case"[object String]":return new a(e);case"[object RegExp]":return(i=new(o=e).constructor(o.source,mn.exec(o))).lastIndex=o.lastIndex,i;case"[object Set]":return new a;case"[object Symbol]":return r=e,jn?Object(jn.call(r)):{}}}function Fn(e){return"function"!=typeof e.constructor||Le(e)?{}:je(Pt(e))}var wn=nt&&nt.isMap,xn=wn?Ye(wn):function(e){return L(e)&&"[object Map]"==vn(e)};var Tn=nt&&nt.isSet,An=Tn?Ye(Tn):function(e){return L(e)&&"[object Set]"==vn(e)},En={};function Sn(e,t,n,r,o,i){var a,l=1&t,u=2&t,s=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!Q(e))return e;var c=q(e);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&hn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Oe(e,a)}else{var d=vn(e),p="[object Function]"==d||"[object GeneratorFunction]"==d;if(Ke(e))return Jt(e,l);if("[object Object]"==d||"[object Arguments]"==d||p&&!o){if(a=u||p?{}:Fn(e),!l)return u?function(e,t){return $e(e,en(e),t)}(e,function(e,t){return e&&$e(t,ft(t),e)}(a,e)):function(e,t){return $e(e,Zt(e),t)}(e,function(e,t){return e&&$e(t,ct(t),e)}(a,e))}else{if(!En[d])return o?e:{};a=On(e,d,l)}}i||(i=new qt);var f=i.get(e);if(f)return f;i.set(e,a),An(e)?e.forEach((function(r){a.add(Sn(r,t,n,r,e,i))})):xn(e)&&e.forEach((function(r,o){a.set(o,Sn(r,t,n,o,e,i))}));var v=c?void 0:(s?u?rn:nn:u?ft:ct)(e);return function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););}(v||e,(function(r,o){v&&(r=e[o=r]),Me(a,o,Sn(r,t,n,o,e,i))})),a}En["[object Arguments]"]=En["[object Array]"]=En["[object ArrayBuffer]"]=En["[object DataView]"]=En["[object Boolean]"]=En["[object Date]"]=En["[object Float32Array]"]=En["[object Float64Array]"]=En["[object Int8Array]"]=En["[object Int16Array]"]=En["[object Int32Array]"]=En["[object Map]"]=En["[object Number]"]=En["[object Object]"]=En["[object RegExp]"]=En["[object Set]"]=En["[object String]"]=En["[object Symbol]"]=En["[object Uint8Array]"]=En["[object Uint8ClampedArray]"]=En["[object Uint16Array]"]=En["[object Uint32Array]"]=!0,En["[object Error]"]=En["[object Function]"]=En["[object WeakMap]"]=!1;function Dn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new xt;++t<n;)this.add(e[t])}function Un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}Dn.prototype.add=Dn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(e){return this.__data__.has(e)};function kn(e,t,n,r,o,i){var a=1&n,l=e.length,u=t.length;if(l!=u&&!(a&&u>l))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,f=2&n?new Dn:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var v=e[d],h=t[d];if(r)var y=a?r(h,v,d,t,e,i):r(v,h,d,e,t,i);if(void 0!==y){if(y)continue;p=!1;break}if(f){if(!Un(t,(function(e,t){if(a=t,!f.has(a)&&(v===e||o(v,e,n,r,i)))return f.push(t);var a}))){p=!1;break}}else if(v!==h&&!o(v,h,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p}function Cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Mn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $n=C?C.prototype:void 0,In=$n?$n.valueOf:void 0;var Pn=Object.prototype.hasOwnProperty;var zn="[object Object]",Bn=Object.prototype.hasOwnProperty;function Nn(e,t,n,r,o,i){var a=q(e),l=q(t),u=a?"[object Array]":vn(e),s=l?"[object Array]":vn(t),c=(u="[object Arguments]"==u?zn:u)==zn,d=(s="[object Arguments]"==s?zn:s)==zn,p=u==s;if(p&&Ke(e)){if(!Ke(t))return!1;a=!0,c=!1}if(p&&!c)return i||(i=new qt),a||ot(e)?kn(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new yn(e),new yn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ke(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=Cn;case"[object Set]":var u=1&r;if(l||(l=Mn),e.size!=t.size&&!u)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var c=kn(l(e),l(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(In)return In.call(e)==In.call(t)}return!1}(e,t,u,n,r,o,i);if(!(1&n)){var f=c&&Bn.call(e,"__wrapped__"),v=d&&Bn.call(t,"__wrapped__");if(f||v){var h=f?e.value():e,y=v?t.value():t;return i||(i=new qt),o(h,y,n,r,i)}}return!!p&&(i||(i=new qt),function(e,t,n,r,o,i){var a=1&n,l=nn(e),u=l.length;if(u!=nn(t).length&&!a)return!1;for(var s=u;s--;){var c=l[s];if(!(a?c in t:Pn.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var v=a;++s<u;){var h=e[c=l[s]],y=t[c];if(r)var b=a?r(y,h,c,t,e,i):r(h,y,c,e,t,i);if(!(void 0===b?h===y||o(h,y,n,r,i):b)){f=!1;break}v||(v="constructor"==c)}if(f&&!v){var m=e.constructor,g=t.constructor;m==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,o,i))}function Ln(e,t,n,r,o){return e===t||(null==e||null==t||!L(e)&&!L(t)?e!=e&&t!=t:Nn(e,t,n,r,Ln,o))}var Rn,Vn=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var l=i[Rn?a:++r];if(!1===t(o[l],l,o))break}return e},qn=function(){return k.Date.now()},Wn=Math.max,Hn=Math.min;function Xn(e,t,n){var r,o,i,a,l,u,s=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,i=o;return r=o=void 0,s=t,a=e.apply(i,n)}function v(e){return s=e,l=setTimeout(y,t),c?f(e):a}function h(e){var n=e-u;return void 0===u||n>=t||n<0||d&&e-s>=i}function y(){var e=qn();if(h(e))return b(e);l=setTimeout(y,function(e){var n=t-(e-u);return d?Hn(n,i-(e-s)):n}(e))}function b(e){return l=void 0,p&&r?f(e):(r=o=void 0,a)}function m(){var e=qn(),n=h(e);if(r=arguments,o=this,u=e,n){if(void 0===l)return v(u);if(d)return clearTimeout(l),l=setTimeout(y,t),f(u)}return void 0===l&&(l=setTimeout(y,t)),a}return t=ne(t)||0,Q(n)&&(c=!!n.leading,i=(d="maxWait"in n)?Wn(ne(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),m.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=u=o=l=void 0},m.flush=function(){return void 0===l?a:b(qn())},m}function Gn(e,t,n){(void 0!==n&&!ke(e[t],n)||void 0===n&&!(t in e))&&Ue(e,t,n)}function Jn(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Kn(e,t,n,r,o,i,a){var l=Jn(e,n),u=Jn(t,n),s=a.get(u);if(s)Gn(e,n,s);else{var c,d=i?i(l,u,n+"",e,t,a):void 0,p=void 0===d;if(p){var f=q(u),v=!f&&Ke(u),h=!f&&!v&&ot(u);d=u,f||v||h?q(l)?d=l:L(c=l)&&Be(c)?d=Oe(l):v?(p=!1,d=Jt(u,!0)):h?(p=!1,d=_n(u,!0)):d=[]:Vt(u)||He(u)?(d=l,He(l)?d=function(e){return $e(e,ft(e))}(l):Q(l)&&!oe(l)||(d=Fn(u))):p=!1}p&&(a.set(u,d),o(d,u,r,i,a),a.delete(u)),Gn(e,n,d)}}function Qn(e,t,n,r,o){e!==t&&Vn(t,(function(i,a){if(o||(o=new qt),Q(i))Kn(e,t,a,n,Qn,r,o);else{var l=r?r(Jn(e,a),i,a+"",e,t,o):void 0;void 0===l&&(l=i),Gn(e,a,l)}}),ft)}function Yn(e,t){return t.length<2?e:function(e,t){for(var n=0,r=(t=Dt(t,e)).length;null!=e&&n<r;)e=e[Ut(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(t,0,-1))}var Zn,er=(Zn=function(e,t,n){Qn(e,t,n)},function(e,t){return Ee(Pe(e,t,re),e+"")}((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Zn.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Q(n))return!1;var r=typeof t;return!!("number"==r?Be(n)&&De(t,n.length):"string"==r&&t in n)&&ke(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var a=t[n];a&&Zn(e,a,n,o)}return e})));function tr(e,t){return null==(e=Yn(e,t=Dt(t,e)))||delete e[Ut((n=t,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function nr(e){return Vt(e)?void 0:e}var rr=function(e){return Ee(Pe(e,void 0,It),e+"")}((function(e,t){var n={};if(null==e)return n;var r=!1;t=V(t,(function(t){return t=Dt(t,e),r||(r=t.length>1),t})),$e(e,rn(e),n),r&&(n=Sn(n,7,nr));for(var o=t.length;o--;)tr(n,t[o]);return n}));const{ANIMATION_TIME:or}={ANIMATION_TIME:300,ANIMATION_NAME:"slide-in",ID_PREFIX:"toast-message"};let ir=1060;const{ANIMATION_NAME:ar,ANIMATION_TIME:lr,ID_PREFIX:ur}={ANIMATION_TIME:300,ANIMATION_NAME:"slide-in",ID_PREFIX:"toast-message"};var sr,cr,dr=s({name:"DToast",inheritAttrs:!1,props:T,emits:["closeEvent","valueChange"],setup(e,t){const{onCloseEvent:n,onHidden:r,onValueChange:o}=function(){const e=d();return{onCloseEvent:function(t){e.emit("closeEvent",t)},onValueChange:function(t){e.emit("valueChange",t)},onHidden:function(){setTimeout((()=>{var t,n;return null==(n=(t=e.attrs).onHidden)?void 0:n.call(t)}),or)}}}(),{severityDelay:i}={severityDelay:function(e){switch(e.severity){case"warn":case"error":return 1e4;default:return 5e3}}},a=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Q(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Xn(e,t,{leading:r,maxWait:t,trailing:o})}((function(t){"single"===e.lifeMode&&g[t]&&(g[t]=clearTimeout(g[t]),g.splice(t,1));E(l.value[t]),setTimeout((()=>{n(l.value[t]),l.value.splice(t,1),o(l.value),"global"===e.lifeMode&&x()}),lr)}),lr),l=p([]),u=p([]),s=p(),c=p([]);let b,m=Date.now();const g=[],j=f((()=>null!==e.life?e.life:l.value.length>0?i(l.value[0]):5e3));function _(e=[]){const t=function(e){return Sn(e,5)}(e);l.value=t.map(((e,t)=>er(e,{id:`${ur}-${t}`}))),u.value=[]}function O(e,t){E(e),setTimeout((()=>{n(e),S()?l.value.splice(t,1):l.value=[],o(l.value)}),lr)}function F(t){if(!e.sticky&&b){b=clearTimeout(b);const e=j.value-(Date.now()-m);b=setTimeout((()=>t()),e)}}function w(){l.value.length>0&&(u.value=[],setTimeout((()=>{l.value.forEach((e=>n(e))),l.value=[],o(l.value)}),lr))}function x(t,n){if(!(-1===l.value.findIndex((e=>e===n)))&&(void 0===n||u.value.includes(n)))if("single"===e.lifeMode){const e=(n.life||i(n))-(Date.now()-m);g[t]=setTimeout((()=>O(n,t)),e)}else F((()=>w()))}function T(e){e<c.value.length&&e>-1&&a(e)}function A(e){const t=["id"];T(l.value.findIndex((n=>{return r=rr(n,t),o=rr(e,t),Ln(r,o);var r,o})))}function E(e){u.value=u.value.filter((t=>t!==e))}function S(){return u.value.length>0}return v((()=>e.value),(t=>{0!==t.length&&(S()&&_(),h((()=>{_(t),function(){if(function(){ir++}(),setTimeout((()=>{l.value.forEach((e=>u.value.push(e)))}),0),e.sticky)return;b&&(b=clearTimeout(b));g.length>0&&g.splice(0).forEach((e=>clearTimeout(e)));m=Date.now(),"single"===e.lifeMode?setTimeout((()=>{l.value.forEach(((e,t)=>{g[t]=setTimeout((()=>O(e,t)),e.life||i(e))}))})):b=setTimeout((()=>w()),j.value)}()})))}),{deep:!0,immediate:!0}),v(l,(e=>{0===e.length&&u.value.length>0&&(u.value=[])})),v(u,((e,t)=>{t.length>0&&0===e.length&&r()})),y((()=>{e.sticky||("single"===e.lifeMode?g.forEach((e=>e&&clearTimeout(e))):clearTimeout(b))})),{messages:l,msgAnimations:u,containerRef:s,msgItemRefs:c,interrupt:function(t){u.value.includes(l.value[t])&&("single"===e.lifeMode?g[t]&&(g[t]=clearTimeout(g[t])):F((()=>{l.value.forEach(((e,n)=>t!==n&&E(e)))})))},removeReset:x,removeThrottle:a,close:function(e){if(void 0===e)return w();"number"==typeof e?T(e):A(e)},msgItemRef:function(e){return c.value[e]}}},render(){const{style:e,styleClass:t,messages:n,msgAnimations:r,msgItemRefs:o,life:i,interrupt:a,removeReset:l,removeThrottle:u,$attrs:s,$slots:d}=this,p="devui-toast",f=e=>["devui-toast-item-container",`devui-toast-message-${e.severity}`,{[ar]:r.includes(e)}],v=e=>!(!e.summary&&null!==i),h=e=>"common"!==e.severity,y=e=>!!e.summary,m=e=>!!e.content,g=e=>!m(e)&&!!e.detail,j=e=>{var t;if("function"==typeof e.content)return e.content(e);if([null,void 0].includes(e.content))return null;const n="slot:";return String(e.content).startsWith(n)?null==(t=d[e.content.slice(n.length)])?void 0:t.call(d,e):e.content};return c("div",b({ref:"containerRef",style:[`z-index: ${ir}`,e],class:[p,t]},s),[n.map(((e,t)=>c("div",{ref:e=>o[t]=e,key:e.id,class:f(e),"aria-live":"polite",onMouseenter:()=>a(t),onMouseleave:()=>l(t,e)},[c("div",{class:"devui-toast-item"},[v(e)?c(E,{prefixCls:p,onClick:()=>u(t)},null):null,h(e)?c(S,{prefixCls:p,severity:e.severity},null):null,c("div",{class:"devui-toast-message"},[y(e)?c("span",{class:"devui-toast-title"},[e.summary]):null,m(e)?j(e):null,g(e)?c("p",{innerHTML:e.detail},null):null])])])))])}});class pr{static open(e){let r=document.body,o=document.createElement("div");r.appendChild(o);let i=function(e){return m(dr,e)}((a=l({},null!=e?e:{}),t(a,n({onHidden:()=>null==i?void 0:i.unmount()}))));var a;let u=i.mount(o);return y((()=>{r.removeChild(o),r=null,o=null,i=null,u=null}),u.$),{toastInstance:u}}}dr.install=function(e){e.component(dr.name,dr)},(cr=sr||(sr={}))[cr.preLoad=0]="preLoad",cr[cr.uploading=1]="uploading",cr[cr.uploaded=2]="uploaded",cr[cr.failed=3]="failed";const fr={uploadOptions:{type:Object,required:!0},fileOptions:{type:Object,required:!0},autoUpload:{type:Boolean,default:!1},placeholderText:{type:String,default:"选择文件"},uploadText:{type:String,default:"上传"},uploadedFiles:{type:Array,default:()=>[]},withoutBtn:{type:Boolean,default:!1},enableDrop:{type:Boolean,default:!1},beforeUpload:{type:Function},dynamicUploadOptionsFn:{type:Function},disabled:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},onChange:{type:Function},fileDrop:{type:Function,default:void 0},fileOver:{type:Function,default:void 0},fileSelect:{type:Function,default:void 0},errorEvent:{type:Function,default:void 0},successEvent:{type:Function,default:void 0},deleteUploadedFileEvent:{type:Function,default:void 0}},vr={uploadOptions:{type:Object,required:!0},fileOptions:{type:Object,required:!0},autoUpload:{type:Boolean,default:!1},withoutBtn:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},uploadedFiles:{type:Array,default:()=>[]},enableDrop:{type:Boolean,default:!1},placeholderText:{type:String,default:"选择文件"},uploadText:{type:String,default:"上传"},oneTimeUpload:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},beforeUpload:{type:Function},fileDrop:{type:Function,default:void 0},fileOver:{type:Function,default:void 0},fileSelect:{type:Function,default:void 0},errorEvent:{type:Function,default:void 0},successEvent:{type:Function,default:void 0},deleteUploadedFileEvent:{type:Function,default:void 0},setCustomUploadOptions:{type:Function,default:void 0}};class hr{constructor(e,t){u(this,"xhr"),u(this,"status"),u(this,"response"),u(this,"percentage",0),this.file=e,this.uploadOptions=t,this.file=e,this.uploadOptions=t,this.status=sr.preLoad}send(e){return new Promise(((t,n)=>{const{uri:r,method:o,headers:i,authToken:a,authTokenHeader:l,additionalParameter:u,fileFieldName:s,withCredentials:c,responseType:d}=this.uploadOptions,p=l||"Authorization",f=s||"file";this.xhr=new XMLHttpRequest,this.xhr.open(o||"POST",r),c&&(this.xhr.withCredentials=c),d&&(this.xhr.responseType=d),a&&this.xhr.setRequestHeader(p,a),i&&Object.keys(i).forEach((e=>{this.xhr.setRequestHeader(e,i[e])})),this.xhr.upload.onprogress=e=>{this.percentage=Math.round(100*e.loaded/e.total)};const v=e&&e.length?this.oneTimeUploadFiles(f,u,e):this.parallelUploadFiles(f,u);this.xhr.send(v),this.status=sr.uploading,this.xhr.onabort=()=>{this.status=sr.preLoad,this.xhr=null},this.xhr.onerror=()=>{this.response=this.xhr.response,this.status=sr.failed,n({file:this.file,response:this.xhr.response})},this.xhr.onload=()=>{4===this.xhr.readyState&&this.xhr.status>=200&&this.xhr.status<300?(this.response=this.xhr.response,this.status=sr.uploaded,t({file:this.file,response:this.xhr.response})):(this.response=this.xhr.response,this.status=sr.failed,n({file:this.file,response:this.xhr.response}))}}))}parallelUploadFiles(e,t){const n=new FormData;return n.append(e,this.file,this.file.name),t&&Object.keys(t).forEach((e=>{n.append(e,t[e])})),n}oneTimeUploadFiles(e,t,n){const r=new FormData;return n.forEach((n=>{r.append(e,n.file,n.file.name),t&&Object.keys(t).forEach((e=>{r.append(e,t[e])}))})),r}cancel(){this.xhr&&this.xhr.abort()}}const yr=()=>{const e=p([]),t=p([]);return{fileUploaders:e,getFiles:()=>e.value.map((e=>e.file)),addFile:(n,r)=>{r&&r.checkSameName?(n=>{let r=!0;for(let o=0;o<e.value.length;o++)if(n===e.value[o].file.name){r=!1,-1===t.value.indexOf(n)&&t.value.push(n);break}return r})(n.name)&&e.value.push(new hr(n,r)):e.value.push(new hr(n,r))},getFullFiles:()=>e.value.map((e=>e)),deleteFile:t=>{e.value.find((e=>e.file===t)).cancel(),e.value=e.value.filter((e=>t!==e.file))},upload:async t=>{let n=[];if(t){t.percentage=0;const e=await t.send();n.push(e)}else{const t=e.value.filter((e=>e.status===sr.preLoad)),r=e.value.filter((e=>e.status===sr.failed)),o=t.length>0?t:r;n=await Promise.all(o.map((async e=>{e.percentage=0;return await e.send()})))}return n.length>0?Promise.resolve(n):Promise.reject("no files")},removeFiles:()=>{e.value=[],t.value=[]},getSameNameFiles:()=>t.value.join(),resetSameNameFiles:()=>{t.value=[]},_oneTimeUpload:()=>(async e=>{if(!e||!e.length)return Promise.reject("no files");let t=[];return await e[0].send(e).finally((()=>t=e.map((t=>(t.status=e[0].status,t.percentage=e[0].percentage,{file:t.file,response:e[0].response}))))),t})(e.value.filter((e=>e.status!==sr.uploaded)))}},br="上传中...",mr="上传失败",gr="上传成功!",jr="重新上传",_r=(e,t)=>`最大支持上传${t}MB的文件, 您上传的文件"${e}"超过可上传文件大小`,Or=()=>{const e=p(""),t=({multiple:e,accept:t,webkitdirectory:n})=>new Promise((r=>{const o=document.getElementById("d-upload-temp");o&&document.body.removeChild(o);const i=document.createElement("input");i.style.position="fixed",i.style.left="-2000px",i.style.top="-2000px",i.setAttribute("id","d-upload-temp"),i.setAttribute("type","file"),e&&i.setAttribute("multiple",""),t&&i.setAttribute("accept",t),n&&i.setAttribute("webkitdirectory",""),i.addEventListener("change",(e=>{r(Array.prototype.slice.call(e.target.files))})),document.body.appendChild(i),(e=>{const t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(t)})(i)})),n=(e,t)=>!!t&&e>1048576*t;return{triggerSelectFiles:e=>{const{multiple:n,accept:r,webkitdirectory:o}=e;return t({multiple:n,accept:r,webkitdirectory:o})},_validateFiles:(e,t,r)=>{return((e,t)=>{if(e){const n=e.split(","),r=t.type.replace(/\/.*$/,"");return n.some((e=>{const n=e.trim();return n.startsWith(".")?t.name.toLowerCase().indexOf(n.toLowerCase(),t.name.toLowerCase().length-n.toLowerCase().length)>-1:/\/\*$/.test(n)?r===n.replace(/\/.*$/,""):t.type===n}))}return!0})(t,e)?r&&n(e.size,r.maximumSize)?{checkError:!0,errorMsg:_r(e.name,r.maximumSize)}:{checkError:!1,errorMsg:void 0}:{checkError:!0,errorMsg:(o=e.name,i=t,`支持的文件类型: "${i}", 您上传的文件"${o}"不在允许范围内,请重新选择文件`)};var o,i},triggerDropFiles:e=>Promise.resolve(e),checkAllFilesSize:(t,r)=>{if(n(t,r))return e.value=`最大支持上传${r}MB的文件, 您本次上传的所有文件超过可上传文件大小`,{checkError:!0,errorMsg:e.value}}}};var Fr=s({name:"DSingleUpload",props:fr,emits:["fileDrop","fileOver","fileSelect","successEvent","errorEvent","deleteUploadedFileEvent","update:uploadedFiles"],setup(e,t){const{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:a,uploadText:l,disabled:u,beforeUpload:s,enableDrop:c,showTip:d,uploadedFiles:v}=g(e),h=p(!1),{getFiles:y,fileUploaders:b,addFile:m,getFullFiles:j,deleteFile:_,upload:O,removeFiles:F}=yr(),{triggerSelectFiles:w,_validateFiles:x,triggerDropFiles:T}=Or(),A=f((()=>(y()[0]||{}).name||"")),E=e=>{pr.open({value:[{severity:"warn",content:e}]})},S=()=>{(()=>{let e=Promise.resolve(!0);if(s.value){const t=s.value(j()[0]||{});void 0!==t&&(e=t.then?t:Promise.resolve(t))}return e})().then((e=>{e&&O().then((e=>{t.emit("successEvent",e);const n=[...e.map((e=>e.file)),...v.value];t.emit("update:uploadedFiles",n)})).catch((e=>{console.error(e),b.value[0]&&(b.value[0].percentage=0),t.emit("errorEvent",e)}))}))},D=o=>{o.then((o=>{var a;o.forEach((e=>{F(),m(e,n.value)})),b.value.forEach((e=>{const t=x(e.file,r.value.accept,e.uploadOptions);t.checkError&&(_(e.file),E(t.errorMsg))}));const l=null==(a=b.value[0])?void 0:a.file;e.onChange&&e.onChange(l),l&&t.emit("fileSelect",l),i.value&&S()})).catch((e=>{E(e.message)}))};return{placeholderText:o,filename:A,autoUpload:i,withoutBtn:a,fileUploaders:b,uploadText:l,handleClick:()=>{var e;u.value||b.value[0]&&(null==(e=b.value[0])?void 0:e.status)===sr.uploading||D(w(r.value))},onDeleteFile:e=>{e.stopPropagation();const t=y();_(t[0])},fileUpload:S,enableDrop:c,onFileDrop:e=>{h.value=!1,D(T(e)),t.emit("fileDrop",e[0])},onFileOver:e=>{h.value=e,t.emit("fileOver",e)},isDropOVer:h,showTip:d,uploadedFiles:v,deleteUploadedFile:e=>{const n=v.value.filter((t=>t.name!==e.name));t.emit("deleteUploadedFileEvent",e),t.emit("update:uploadedFiles",n)}}},render(){var e,t,n,r,o,i,a,l,u,s,d,p,f,v,h,y;const{placeholderText:b,filename:m,autoUpload:g,withoutBtn:w,fileUploaders:x,uploadText:T,handleClick:A,onDeleteFile:E,fileUpload:S,enableDrop:D,onFileDrop:U,onFileOver:k,isDropOVer:C,disabled:M,showTip:$,uploadedFiles:I,deleteUploadedFile:P}=this;return c("div",null,[j(c("div",{class:"devui-upload",style:"border: "+(C?"1px solid #15bf15":"0")},[(null==(t=(e=this.$slots).default)?void 0:t.call(e))?c("div",{onClick:A},[this.$slots.default()]):c("div",{class:"devui-input-group "+(M||(null==(n=x[0])?void 0:n.status)===sr.uploading?"disabled":""),onClick:A},[c("div",{class:"devui-form-control devui-files-list"},[!m&&c("div",{class:"devui-file-item devui-upload-placeholder"},[b]),!!m&&c("div",{class:"devui-file-tag devui-file-item",title:m,style:"display: inline-block; margin: 0 2px 2px 0"},[c("span",{class:"devui-filename "+((null==(r=x[0])?void 0:r.status)===sr.failed?"devui-failed-color":"")},[m]),c(_("d-icon"),{name:"close",class:`${(null==(o=x[0])?void 0:o.status)===sr.failed?"devui-upload-delete-file-button":""} ${(null==(i=x[0])?void 0:i.status)===sr.uploading||(null==(a=x[0])?void 0:a.status)===sr.uploaded?"devui-uploading-delete":""}`,onClick:e=>E(e)},null),(null==(l=x[0])?void 0:l.status)===sr.uploading&&c("div",{class:"icon devui-upload-progress"},[c(_("d-progress"),{isCircle:!0,percentage:x[0].percentage,barbgcolor:"#50D4AB",strokeWidth:8,showContent:!1},null)]),x[0].status===sr.failed&&c(_("d-icon"),{name:"running",onClick:S},null),x[0].status===sr.uploaded&&c(_("d-icon"),{name:"right",color:"#50d4ab"},null)])]),c("span",{class:"devui-input-group-addon"},[c(_("d-icon"),{name:"more-operate",color:"#252b3a"},null)])]),!g&&!w&&c(_("d-button"),{style:"marginLeft: 8px",bsStyle:"common",onClick:S,disabled:M||(null==(u=x[0])?void 0:u.status)===sr.uploading},{default:()=>{var e,t,n,r;return[(!x[0]||!(null==(e=x[0])?void 0:e.status))&&c("span",null,[T]),(null==(t=x[0])?void 0:t.status)===sr.uploading&&c("span",null,[O("上传中...")]),(null==(n=x[0])?void 0:n.status)===sr.uploaded&&c("span",null,[O("已上传")]),(null==(r=x[0])?void 0:r.status)===sr.failed&&c("span",null,[O("上传失败")])]}})]),[[F("file-drop"),{enableDrop:D,isSingle:!0,onFileDrop:U,onFileOver:k}]]),$&&c("div",{class:"devui-upload-tip"},[(null==(s=x[0])?void 0:s.status)===sr.uploading&&c("span",{class:"devui-loading"},[br]),(null==(d=x[0])?void 0:d.status)===sr.uploaded&&c("div",{class:"devui-loaded"},[c(_("d-icon"),{name:"right-o",color:"#50d4ab"},null),c("span",{style:"vertical-align: middle"},[gr])]),(null==(p=x[0])?void 0:p.status)===sr.failed&&c("div",{class:"devui-upload-failed"},[c(_("d-icon"),{name:"info-o",color:"#f66f6a"},null),c("span",{style:"vertical-align: middle"},[c("span",{style:"margin-right: 8px"},[mr]),c("a",{onClick:S},[jr])])])]),c("div",null,[null==(v=(f=this.$slots).preloadFiles)?void 0:v.call(f,{fileUploaders:x,deleteFile:E})]),c("div",null,[null==(y=(h=this.$slots).uploadedFiles)?void 0:y.call(h,{uploadedFiles:I,deleteFile:P})])])}});var wr=s({name:"DMultipleUpload",props:vr,emits:["fileDrop","fileOver","fileSelect","successEvent","errorEvent","deleteUploadedFileEvent","update:uploadedFiles"],setup(e,t){const{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:a,uploadText:l,disabled:u,beforeUpload:s,enableDrop:c,oneTimeUpload:d,showTip:f,uploadedFiles:v}=g(e),{triggerSelectFiles:h,_validateFiles:y,triggerDropFiles:b,checkAllFilesSize:m}=Or(),{getFiles:j,fileUploaders:_,addFile:O,getFullFiles:F,deleteFile:w,upload:x,resetSameNameFiles:T,removeFiles:A,_oneTimeUpload:E,getSameNameFiles:S}=yr(),D=p(!1),U=p(""),k=e=>{pr.open({value:[{severity:"warn",content:e}]})},C=e=>{T(),e.then((e=>{e.forEach((e=>{O(e,n.value)})),(()=>{let e=0;if(_.value.forEach((t=>{e+=t.file.size;const n=y(t.file,r.value.accept,t.uploadOptions);if(n&&n.checkError)return w(t.file),void k(n.errorMsg)})),d.value){const t=m(e,n.value.maximumSize);t&&t.checkError&&(A(),k(t.errorMsg))}})();const o=S();n.value.checkSameName&&o.length&&k(`您上传的 "${o}" 存在重名文件, 请重新选择文件`);const a=_.value.filter((e=>e.status===sr.preLoad)).map((e=>e.file));t.emit("fileSelect",a),i.value&&x()})).catch((e=>{k(e.message)}))};return{uploadOptions:n,fileOptions:r,placeholderText:o,autoUpload:i,withoutBtn:a,uploadText:l,disabled:u,beforeUpload:s,enableDrop:c,isDropOVer:D,onFileDrop:e=>{D.value=!1,C(b(e)),t.emit("fileDrop",e)},onFileOver:e=>{D.value=e,t.emit("fileOver",e)},handleClick:()=>{u.value||C(h(r.value))},fileUploaders:_,onDeleteFile:(e,t)=>{e.stopPropagation(),w(t)},fileUpload:(e,n)=>{e&&e.stopPropagation(),(()=>{let e=Promise.resolve(!0);if(s.value){const t=s.value(F());void 0!==t&&(e=t.then?t:Promise.resolve(t))}return e})().then((e=>{if(!e)return void A();(d.value?E():x(n)).then((e=>{t.emit("successEvent",e);const n=[...e.map((e=>e.file)),...v.value];t.emit("update:uploadedFiles",n)})).catch((e=>{t.emit("errorEvent",e)}))}))},showTip:f,getStatus:()=>{let e=0,t=0,n=0;const r=_.value.length;return _.value.forEach((r=>{r.status===sr.uploading?e++:r.status===sr.uploaded?t++:r.status===sr.failed&&n++})),n>0?(U.value=(e=>`${e}个文件上传失败!`)(n),"failed"):e>0?(U.value=((e,t)=>`${e}/${t}正在上传`)(e,r),"uploading"):t===r&&0!==t?"uploaded":0!==r?(U.value=(e=>`已添加${e}个文件`)(r),"selected"):void 0},uploadTips:U,cancelUpload:()=>{_.value=_.value.map((e=>(e.status===sr.uploading&&(e.cancel(),e.status=sr.failed),e)))},deleteUploadedFile:e=>{const n=v.value.filter((t=>t.name!==e.name));t.emit("deleteUploadedFileEvent",e),t.emit("update:uploadedFiles",n)}}},render(){var e,t,n,r,o,i;const{placeholderText:a,autoUpload:l,withoutBtn:u,uploadText:s,disabled:d,beforeUpload:p,enableDrop:f,isDropOVer:v,onFileDrop:h,onFileOver:y,handleClick:b,fileUploaders:m,onDeleteFile:g,fileUpload:O,showTip:T,getStatus:A,uploadTips:E,cancelUpload:S,uploadedFiles:D,deleteUploadedFile:U}=this;return c(w,null,[j(c("div",{class:"devui-upload",style:"border: "+(v?"1px solid #15bf15":"0")},[(null==(t=(e=this.$slots).default)?void 0:t.call(e))?c("div",{onClick:b},[this.$slots.default()]):c("div",{class:"devui-input-group "+(d?"disabled":""),onClick:b},[0===m.length&&c("div",{class:"devui-form-control devui-upload-placeholder"},[a]),m.length>0&&c("ul",{class:"devui-form-control devui-files-list"},[m.map(((e,t)=>c("li",{key:t,class:"devui-file-item devui-file-tag",style:"display: inline-block; margin: 0 2px 2px 0",title:e.file.name},[c("span",{class:"evui-filename "+(e.status===sr.failed?"devui-failed-color":"")},[e.file.name]),c(_("d-icon"),{name:"close",class:`${(null==e?void 0:e.status)===sr.failed?"devui-upload-delete-file-button":""} ${(null==e?void 0:e.status)===sr.uploading||(null==e?void 0:e.status)===sr.uploaded?"devui-uploading-delete":""}`,onClick:t=>g(t,e.file)},null),e.status===sr.uploading&&c("div",{class:"icon devui-upload-progress"},[c(_("d-progress"),{isCircle:!0,percentage:e.percentage,barbgcolor:"#50D4AB",strokeWidth:8,showContent:!1},null)]),e.status===sr.failed&&c(_("d-icon"),{name:"running",onClick:O},null),e.status===sr.uploaded&&c(_("d-icon"),{name:"right",color:"#50d4ab"},null)])))]),c("span",{class:"devui-input-group-addon"},[c(_("d-icon"),{name:"more-operate",color:"#252b3a"},null)])]),!l&&!u&&c(_("d-button"),{style:"marginLeft: 8px",bsStyle:"common",disabled:d,onClick:O},(k=s,"function"==typeof k||"[object Object]"===Object.prototype.toString.call(k)&&!x(k)?s:{default:()=>[s]}))]),[[F("file-drop"),{enableDrop:f,isSingle:!1,onFileDrop:h,onFileOver:y}]]),c("div",null,[null==(r=(n=this.$slots).preloadFiles)?void 0:r.call(n,{fileUploaders:m,deleteFile:g})]),c("div",null,[null==(i=(o=this.$slots).uploadedFiles)?void 0:i.call(o,{uploadedFiles:D,deleteFile:U})])]);var k}});const xr=e=>{var t;return e.dataTransfer?e.dataTransfer:null==(t=e.originalEvent)?void 0:t.dataTransfer},Tr=e=>{e.preventDefault(),e.stopPropagation()},Ar={mounted:(e,t)=>{const{enableDrop:n}=t.value;n&&(((e,t)=>{const{onFileOver:n}=t.value;e.addEventListener("dragover",(e=>{var t;(t=xr(e).types)&&(t.indexOf?-1!==t.indexOf("Files"):t.contains&&t.contains("Files"))&&(Tr(e),n&&n(!0))}))})(e,t),((e,t)=>{const{onFileOver:n}=t.value;e.addEventListener("dragleave",(t=>{t.currentTarget!==e&&(Tr(t),n&&n(!0))}))})(e,t),((e,t)=>{const{onFileDrop:n,isSingle:r}=t.value;e.addEventListener("drop",(e=>{const t=xr(e);t&&(Tr(e),r?n&&n([t.files[0]]):n&&n(t.files))}))})(e,t))}};Fr.install=function(e){e.directive("file-drop",Ar),e.component(Fr.name,Fr),e.component(wr.name,wr)};var Er={title:"Upload 上传",category:"数据录入",status:"80%",install(e){e.use(Fr)}};export{wr as MultiUpload,Fr as Upload,Er as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
24
+ import { defineComponent, createVNode, getCurrentInstance, ref, computed, watch, nextTick, onUnmounted, mergeProps, createApp, toRefs, withDirectives, resolveComponent, isVNode, resolveDirective } from "vue";
25
+ var toast = "";
26
+ const toastProps = {
27
+ value: {
28
+ type: Array,
29
+ required: true,
30
+ default: () => []
31
+ },
32
+ life: {
33
+ type: Number,
34
+ default: null
35
+ },
36
+ lifeMode: {
37
+ type: String,
38
+ default: "global"
39
+ },
40
+ sticky: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ style: {
45
+ type: Object,
46
+ default: () => ({})
47
+ },
48
+ styleClass: {
49
+ type: String
50
+ },
51
+ onCloseEvent: {
52
+ type: Function
53
+ },
54
+ onValueChange: {
55
+ type: Function
56
+ }
57
+ };
58
+ var Icon = defineComponent({
59
+ name: "DIcon",
60
+ props: {
61
+ name: {
62
+ type: String,
63
+ required: true
64
+ },
65
+ size: {
66
+ type: String,
67
+ default: "inherit"
68
+ },
69
+ color: {
70
+ type: String,
71
+ default: "inherit"
72
+ },
73
+ classPrefix: {
74
+ type: String,
75
+ default: "icon"
76
+ }
77
+ },
78
+ setup(props) {
79
+ return __spreadValues({}, props);
80
+ },
81
+ render() {
82
+ const {
83
+ name,
84
+ size,
85
+ color,
86
+ classPrefix
87
+ } = this;
88
+ return /^((https?):)?\/\//.test(name) ? createVNode("img", {
89
+ "src": name,
90
+ "alt": name.split("/")[name.split("/").length - 1],
91
+ "style": {
92
+ width: size,
93
+ verticalAlign: "text-bottom"
94
+ }
95
+ }, null) : createVNode("i", {
96
+ "class": `${classPrefix} ${classPrefix}-${name}`,
97
+ "style": {
98
+ fontSize: size,
99
+ color
100
+ }
101
+ }, null);
102
+ }
103
+ });
104
+ Icon.install = function(app) {
105
+ app.component(Icon.name, Icon);
106
+ };
107
+ var ToastIconClose = defineComponent({
108
+ name: "DToastIconClose",
109
+ props: {
110
+ prefixCls: String,
111
+ onClick: Function
112
+ },
113
+ emits: ["click"],
114
+ render() {
115
+ const {
116
+ prefixCls,
117
+ $emit
118
+ } = this;
119
+ const wrapperCls = `${prefixCls}-icon-close`;
120
+ return createVNode("div", {
121
+ "class": wrapperCls,
122
+ "onClick": (e) => $emit("click", e)
123
+ }, [createVNode(Icon, {
124
+ "name": "close",
125
+ "size": "14px"
126
+ }, null)]);
127
+ }
128
+ });
129
+ var ToastImage = defineComponent({
130
+ name: "DToastImage",
131
+ props: {
132
+ prefixCls: String,
133
+ severity: String
134
+ },
135
+ render() {
136
+ const {
137
+ prefixCls,
138
+ severity
139
+ } = this;
140
+ const wrapperCls = [`${prefixCls}-image`, `${prefixCls}-image-${severity || "common"}`];
141
+ const severityIconMap = {
142
+ info: "info-o",
143
+ success: "right-o",
144
+ warning: "warning-o",
145
+ error: "error-o"
146
+ };
147
+ const showIcon = () => severity !== "common";
148
+ return createVNode("span", {
149
+ "class": wrapperCls
150
+ }, [showIcon() ? createVNode(Icon, {
151
+ "name": severityIconMap[severity],
152
+ "size": "16px"
153
+ }, null) : null]);
154
+ }
155
+ });
156
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
157
+ var freeGlobal$1 = freeGlobal;
158
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
159
+ var root = freeGlobal$1 || freeSelf || Function("return this")();
160
+ var root$1 = root;
161
+ var Symbol$1 = root$1.Symbol;
162
+ var Symbol$2 = Symbol$1;
163
+ var objectProto$f = Object.prototype;
164
+ var hasOwnProperty$c = objectProto$f.hasOwnProperty;
165
+ var nativeObjectToString$1 = objectProto$f.toString;
166
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
167
+ function getRawTag(value) {
168
+ var isOwn = hasOwnProperty$c.call(value, symToStringTag$1), tag = value[symToStringTag$1];
169
+ try {
170
+ value[symToStringTag$1] = void 0;
171
+ var unmasked = true;
172
+ } catch (e) {
173
+ }
174
+ var result = nativeObjectToString$1.call(value);
175
+ if (unmasked) {
176
+ if (isOwn) {
177
+ value[symToStringTag$1] = tag;
178
+ } else {
179
+ delete value[symToStringTag$1];
180
+ }
181
+ }
182
+ return result;
183
+ }
184
+ var objectProto$e = Object.prototype;
185
+ var nativeObjectToString = objectProto$e.toString;
186
+ function objectToString(value) {
187
+ return nativeObjectToString.call(value);
188
+ }
189
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
190
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
191
+ function baseGetTag(value) {
192
+ if (value == null) {
193
+ return value === void 0 ? undefinedTag : nullTag;
194
+ }
195
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
196
+ }
197
+ function isObjectLike(value) {
198
+ return value != null && typeof value == "object";
199
+ }
200
+ var symbolTag$3 = "[object Symbol]";
201
+ function isSymbol(value) {
202
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
203
+ }
204
+ function arrayMap(array, iteratee) {
205
+ var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
206
+ while (++index2 < length) {
207
+ result[index2] = iteratee(array[index2], index2, array);
208
+ }
209
+ return result;
210
+ }
211
+ var isArray = Array.isArray;
212
+ var isArray$1 = isArray;
213
+ var INFINITY$1 = 1 / 0;
214
+ var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
215
+ function baseToString(value) {
216
+ if (typeof value == "string") {
217
+ return value;
218
+ }
219
+ if (isArray$1(value)) {
220
+ return arrayMap(value, baseToString) + "";
221
+ }
222
+ if (isSymbol(value)) {
223
+ return symbolToString ? symbolToString.call(value) : "";
224
+ }
225
+ var result = value + "";
226
+ return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
227
+ }
228
+ var reWhitespace = /\s/;
229
+ function trimmedEndIndex(string) {
230
+ var index2 = string.length;
231
+ while (index2-- && reWhitespace.test(string.charAt(index2))) {
232
+ }
233
+ return index2;
234
+ }
235
+ var reTrimStart = /^\s+/;
236
+ function baseTrim(string) {
237
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
238
+ }
239
+ function isObject(value) {
240
+ var type = typeof value;
241
+ return value != null && (type == "object" || type == "function");
242
+ }
243
+ var NAN = 0 / 0;
244
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
245
+ var reIsBinary = /^0b[01]+$/i;
246
+ var reIsOctal = /^0o[0-7]+$/i;
247
+ var freeParseInt = parseInt;
248
+ function toNumber(value) {
249
+ if (typeof value == "number") {
250
+ return value;
251
+ }
252
+ if (isSymbol(value)) {
253
+ return NAN;
254
+ }
255
+ if (isObject(value)) {
256
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
257
+ value = isObject(other) ? other + "" : other;
258
+ }
259
+ if (typeof value != "string") {
260
+ return value === 0 ? value : +value;
261
+ }
262
+ value = baseTrim(value);
263
+ var isBinary = reIsBinary.test(value);
264
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
265
+ }
266
+ function identity(value) {
267
+ return value;
268
+ }
269
+ var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
270
+ function isFunction(value) {
271
+ if (!isObject(value)) {
272
+ return false;
273
+ }
274
+ var tag = baseGetTag(value);
275
+ return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
276
+ }
277
+ var coreJsData = root$1["__core-js_shared__"];
278
+ var coreJsData$1 = coreJsData;
279
+ var maskSrcKey = function() {
280
+ var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
281
+ return uid ? "Symbol(src)_1." + uid : "";
282
+ }();
283
+ function isMasked(func) {
284
+ return !!maskSrcKey && maskSrcKey in func;
285
+ }
286
+ var funcProto$2 = Function.prototype;
287
+ var funcToString$2 = funcProto$2.toString;
288
+ function toSource(func) {
289
+ if (func != null) {
290
+ try {
291
+ return funcToString$2.call(func);
292
+ } catch (e) {
293
+ }
294
+ try {
295
+ return func + "";
296
+ } catch (e) {
297
+ }
298
+ }
299
+ return "";
300
+ }
301
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
302
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
303
+ var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
304
+ var funcToString$1 = funcProto$1.toString;
305
+ var hasOwnProperty$b = objectProto$d.hasOwnProperty;
306
+ var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$b).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
307
+ function baseIsNative(value) {
308
+ if (!isObject(value) || isMasked(value)) {
309
+ return false;
310
+ }
311
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
312
+ return pattern.test(toSource(value));
313
+ }
314
+ function getValue(object, key) {
315
+ return object == null ? void 0 : object[key];
316
+ }
317
+ function getNative(object, key) {
318
+ var value = getValue(object, key);
319
+ return baseIsNative(value) ? value : void 0;
320
+ }
321
+ var WeakMap = getNative(root$1, "WeakMap");
322
+ var WeakMap$1 = WeakMap;
323
+ var objectCreate = Object.create;
324
+ var baseCreate = function() {
325
+ function object() {
326
+ }
327
+ return function(proto) {
328
+ if (!isObject(proto)) {
329
+ return {};
330
+ }
331
+ if (objectCreate) {
332
+ return objectCreate(proto);
333
+ }
334
+ object.prototype = proto;
335
+ var result = new object();
336
+ object.prototype = void 0;
337
+ return result;
338
+ };
339
+ }();
340
+ var baseCreate$1 = baseCreate;
341
+ function apply(func, thisArg, args) {
342
+ switch (args.length) {
343
+ case 0:
344
+ return func.call(thisArg);
345
+ case 1:
346
+ return func.call(thisArg, args[0]);
347
+ case 2:
348
+ return func.call(thisArg, args[0], args[1]);
349
+ case 3:
350
+ return func.call(thisArg, args[0], args[1], args[2]);
351
+ }
352
+ return func.apply(thisArg, args);
353
+ }
354
+ function copyArray(source, array) {
355
+ var index2 = -1, length = source.length;
356
+ array || (array = Array(length));
357
+ while (++index2 < length) {
358
+ array[index2] = source[index2];
359
+ }
360
+ return array;
361
+ }
362
+ var HOT_COUNT = 800, HOT_SPAN = 16;
363
+ var nativeNow = Date.now;
364
+ function shortOut(func) {
365
+ var count = 0, lastCalled = 0;
366
+ return function() {
367
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
368
+ lastCalled = stamp;
369
+ if (remaining > 0) {
370
+ if (++count >= HOT_COUNT) {
371
+ return arguments[0];
372
+ }
373
+ } else {
374
+ count = 0;
375
+ }
376
+ return func.apply(void 0, arguments);
377
+ };
378
+ }
379
+ function constant(value) {
380
+ return function() {
381
+ return value;
382
+ };
383
+ }
384
+ var defineProperty = function() {
385
+ try {
386
+ var func = getNative(Object, "defineProperty");
387
+ func({}, "", {});
388
+ return func;
389
+ } catch (e) {
390
+ }
391
+ }();
392
+ var defineProperty$1 = defineProperty;
393
+ var baseSetToString = !defineProperty$1 ? identity : function(func, string) {
394
+ return defineProperty$1(func, "toString", {
395
+ "configurable": true,
396
+ "enumerable": false,
397
+ "value": constant(string),
398
+ "writable": true
399
+ });
400
+ };
401
+ var baseSetToString$1 = baseSetToString;
402
+ var setToString = shortOut(baseSetToString$1);
403
+ var setToString$1 = setToString;
404
+ function arrayEach(array, iteratee) {
405
+ var index2 = -1, length = array == null ? 0 : array.length;
406
+ while (++index2 < length) {
407
+ if (iteratee(array[index2], index2, array) === false) {
408
+ break;
409
+ }
410
+ }
411
+ return array;
412
+ }
413
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
414
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
415
+ function isIndex(value, length) {
416
+ var type = typeof value;
417
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
418
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
419
+ }
420
+ function baseAssignValue(object, key, value) {
421
+ if (key == "__proto__" && defineProperty$1) {
422
+ defineProperty$1(object, key, {
423
+ "configurable": true,
424
+ "enumerable": true,
425
+ "value": value,
426
+ "writable": true
427
+ });
428
+ } else {
429
+ object[key] = value;
430
+ }
431
+ }
432
+ function eq(value, other) {
433
+ return value === other || value !== value && other !== other;
434
+ }
435
+ var objectProto$c = Object.prototype;
436
+ var hasOwnProperty$a = objectProto$c.hasOwnProperty;
437
+ function assignValue(object, key, value) {
438
+ var objValue = object[key];
439
+ if (!(hasOwnProperty$a.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
440
+ baseAssignValue(object, key, value);
441
+ }
442
+ }
443
+ function copyObject(source, props, object, customizer) {
444
+ var isNew = !object;
445
+ object || (object = {});
446
+ var index2 = -1, length = props.length;
447
+ while (++index2 < length) {
448
+ var key = props[index2];
449
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
450
+ if (newValue === void 0) {
451
+ newValue = source[key];
452
+ }
453
+ if (isNew) {
454
+ baseAssignValue(object, key, newValue);
455
+ } else {
456
+ assignValue(object, key, newValue);
457
+ }
458
+ }
459
+ return object;
460
+ }
461
+ var nativeMax$1 = Math.max;
462
+ function overRest(func, start, transform) {
463
+ start = nativeMax$1(start === void 0 ? func.length - 1 : start, 0);
464
+ return function() {
465
+ var args = arguments, index2 = -1, length = nativeMax$1(args.length - start, 0), array = Array(length);
466
+ while (++index2 < length) {
467
+ array[index2] = args[start + index2];
468
+ }
469
+ index2 = -1;
470
+ var otherArgs = Array(start + 1);
471
+ while (++index2 < start) {
472
+ otherArgs[index2] = args[index2];
473
+ }
474
+ otherArgs[start] = transform(array);
475
+ return apply(func, this, otherArgs);
476
+ };
477
+ }
478
+ function baseRest(func, start) {
479
+ return setToString$1(overRest(func, start, identity), func + "");
480
+ }
481
+ var MAX_SAFE_INTEGER = 9007199254740991;
482
+ function isLength(value) {
483
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
484
+ }
485
+ function isArrayLike(value) {
486
+ return value != null && isLength(value.length) && !isFunction(value);
487
+ }
488
+ function isIterateeCall(value, index2, object) {
489
+ if (!isObject(object)) {
490
+ return false;
491
+ }
492
+ var type = typeof index2;
493
+ if (type == "number" ? isArrayLike(object) && isIndex(index2, object.length) : type == "string" && index2 in object) {
494
+ return eq(object[index2], value);
495
+ }
496
+ return false;
497
+ }
498
+ function createAssigner(assigner) {
499
+ return baseRest(function(object, sources) {
500
+ var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
501
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
502
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
503
+ customizer = length < 3 ? void 0 : customizer;
504
+ length = 1;
505
+ }
506
+ object = Object(object);
507
+ while (++index2 < length) {
508
+ var source = sources[index2];
509
+ if (source) {
510
+ assigner(object, source, index2, customizer);
511
+ }
512
+ }
513
+ return object;
514
+ });
515
+ }
516
+ var objectProto$b = Object.prototype;
517
+ function isPrototype(value) {
518
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
519
+ return value === proto;
520
+ }
521
+ function baseTimes(n, iteratee) {
522
+ var index2 = -1, result = Array(n);
523
+ while (++index2 < n) {
524
+ result[index2] = iteratee(index2);
525
+ }
526
+ return result;
527
+ }
528
+ var argsTag$3 = "[object Arguments]";
529
+ function baseIsArguments(value) {
530
+ return isObjectLike(value) && baseGetTag(value) == argsTag$3;
531
+ }
532
+ var objectProto$a = Object.prototype;
533
+ var hasOwnProperty$9 = objectProto$a.hasOwnProperty;
534
+ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
535
+ var isArguments = baseIsArguments(function() {
536
+ return arguments;
537
+ }()) ? baseIsArguments : function(value) {
538
+ return isObjectLike(value) && hasOwnProperty$9.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
539
+ };
540
+ var isArguments$1 = isArguments;
541
+ function stubFalse() {
542
+ return false;
543
+ }
544
+ var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
545
+ var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
546
+ var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
547
+ var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0;
548
+ var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
549
+ var isBuffer = nativeIsBuffer || stubFalse;
550
+ var isBuffer$1 = isBuffer;
551
+ var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
552
+ var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
553
+ var typedArrayTags = {};
554
+ typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
555
+ typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
556
+ function baseIsTypedArray(value) {
557
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
558
+ }
559
+ function baseUnary(func) {
560
+ return function(value) {
561
+ return func(value);
562
+ };
563
+ }
564
+ var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
565
+ var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
566
+ var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
567
+ var freeProcess = moduleExports$1 && freeGlobal$1.process;
568
+ var nodeUtil = function() {
569
+ try {
570
+ var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
571
+ if (types) {
572
+ return types;
573
+ }
574
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
575
+ } catch (e) {
576
+ }
577
+ }();
578
+ var nodeUtil$1 = nodeUtil;
579
+ var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
580
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
581
+ var isTypedArray$1 = isTypedArray;
582
+ var objectProto$9 = Object.prototype;
583
+ var hasOwnProperty$8 = objectProto$9.hasOwnProperty;
584
+ function arrayLikeKeys(value, inherited) {
585
+ var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$1(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
586
+ for (var key in value) {
587
+ if ((inherited || hasOwnProperty$8.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
588
+ result.push(key);
589
+ }
590
+ }
591
+ return result;
592
+ }
593
+ function overArg(func, transform) {
594
+ return function(arg) {
595
+ return func(transform(arg));
596
+ };
597
+ }
598
+ var nativeKeys = overArg(Object.keys, Object);
599
+ var nativeKeys$1 = nativeKeys;
600
+ var objectProto$8 = Object.prototype;
601
+ var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
602
+ function baseKeys(object) {
603
+ if (!isPrototype(object)) {
604
+ return nativeKeys$1(object);
605
+ }
606
+ var result = [];
607
+ for (var key in Object(object)) {
608
+ if (hasOwnProperty$7.call(object, key) && key != "constructor") {
609
+ result.push(key);
610
+ }
611
+ }
612
+ return result;
613
+ }
614
+ function keys(object) {
615
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
616
+ }
617
+ function nativeKeysIn(object) {
618
+ var result = [];
619
+ if (object != null) {
620
+ for (var key in Object(object)) {
621
+ result.push(key);
622
+ }
623
+ }
624
+ return result;
625
+ }
626
+ var objectProto$7 = Object.prototype;
627
+ var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
628
+ function baseKeysIn(object) {
629
+ if (!isObject(object)) {
630
+ return nativeKeysIn(object);
631
+ }
632
+ var isProto = isPrototype(object), result = [];
633
+ for (var key in object) {
634
+ if (!(key == "constructor" && (isProto || !hasOwnProperty$6.call(object, key)))) {
635
+ result.push(key);
636
+ }
637
+ }
638
+ return result;
639
+ }
640
+ function keysIn(object) {
641
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
642
+ }
643
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
644
+ function isKey(value, object) {
645
+ if (isArray$1(value)) {
646
+ return false;
647
+ }
648
+ var type = typeof value;
649
+ if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
650
+ return true;
651
+ }
652
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
653
+ }
654
+ var nativeCreate = getNative(Object, "create");
655
+ var nativeCreate$1 = nativeCreate;
656
+ function hashClear() {
657
+ this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
658
+ this.size = 0;
659
+ }
660
+ function hashDelete(key) {
661
+ var result = this.has(key) && delete this.__data__[key];
662
+ this.size -= result ? 1 : 0;
663
+ return result;
664
+ }
665
+ var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
666
+ var objectProto$6 = Object.prototype;
667
+ var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
668
+ function hashGet(key) {
669
+ var data = this.__data__;
670
+ if (nativeCreate$1) {
671
+ var result = data[key];
672
+ return result === HASH_UNDEFINED$2 ? void 0 : result;
673
+ }
674
+ return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
675
+ }
676
+ var objectProto$5 = Object.prototype;
677
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
678
+ function hashHas(key) {
679
+ var data = this.__data__;
680
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
681
+ }
682
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
683
+ function hashSet(key, value) {
684
+ var data = this.__data__;
685
+ this.size += this.has(key) ? 0 : 1;
686
+ data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
687
+ return this;
688
+ }
689
+ function Hash(entries) {
690
+ var index2 = -1, length = entries == null ? 0 : entries.length;
691
+ this.clear();
692
+ while (++index2 < length) {
693
+ var entry = entries[index2];
694
+ this.set(entry[0], entry[1]);
695
+ }
696
+ }
697
+ Hash.prototype.clear = hashClear;
698
+ Hash.prototype["delete"] = hashDelete;
699
+ Hash.prototype.get = hashGet;
700
+ Hash.prototype.has = hashHas;
701
+ Hash.prototype.set = hashSet;
702
+ function listCacheClear() {
703
+ this.__data__ = [];
704
+ this.size = 0;
705
+ }
706
+ function assocIndexOf(array, key) {
707
+ var length = array.length;
708
+ while (length--) {
709
+ if (eq(array[length][0], key)) {
710
+ return length;
711
+ }
712
+ }
713
+ return -1;
714
+ }
715
+ var arrayProto = Array.prototype;
716
+ var splice = arrayProto.splice;
717
+ function listCacheDelete(key) {
718
+ var data = this.__data__, index2 = assocIndexOf(data, key);
719
+ if (index2 < 0) {
720
+ return false;
721
+ }
722
+ var lastIndex = data.length - 1;
723
+ if (index2 == lastIndex) {
724
+ data.pop();
725
+ } else {
726
+ splice.call(data, index2, 1);
727
+ }
728
+ --this.size;
729
+ return true;
730
+ }
731
+ function listCacheGet(key) {
732
+ var data = this.__data__, index2 = assocIndexOf(data, key);
733
+ return index2 < 0 ? void 0 : data[index2][1];
734
+ }
735
+ function listCacheHas(key) {
736
+ return assocIndexOf(this.__data__, key) > -1;
737
+ }
738
+ function listCacheSet(key, value) {
739
+ var data = this.__data__, index2 = assocIndexOf(data, key);
740
+ if (index2 < 0) {
741
+ ++this.size;
742
+ data.push([key, value]);
743
+ } else {
744
+ data[index2][1] = value;
745
+ }
746
+ return this;
747
+ }
748
+ function ListCache(entries) {
749
+ var index2 = -1, length = entries == null ? 0 : entries.length;
750
+ this.clear();
751
+ while (++index2 < length) {
752
+ var entry = entries[index2];
753
+ this.set(entry[0], entry[1]);
754
+ }
755
+ }
756
+ ListCache.prototype.clear = listCacheClear;
757
+ ListCache.prototype["delete"] = listCacheDelete;
758
+ ListCache.prototype.get = listCacheGet;
759
+ ListCache.prototype.has = listCacheHas;
760
+ ListCache.prototype.set = listCacheSet;
761
+ var Map = getNative(root$1, "Map");
762
+ var Map$1 = Map;
763
+ function mapCacheClear() {
764
+ this.size = 0;
765
+ this.__data__ = {
766
+ "hash": new Hash(),
767
+ "map": new (Map$1 || ListCache)(),
768
+ "string": new Hash()
769
+ };
770
+ }
771
+ function isKeyable(value) {
772
+ var type = typeof value;
773
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
774
+ }
775
+ function getMapData(map, key) {
776
+ var data = map.__data__;
777
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
778
+ }
779
+ function mapCacheDelete(key) {
780
+ var result = getMapData(this, key)["delete"](key);
781
+ this.size -= result ? 1 : 0;
782
+ return result;
783
+ }
784
+ function mapCacheGet(key) {
785
+ return getMapData(this, key).get(key);
786
+ }
787
+ function mapCacheHas(key) {
788
+ return getMapData(this, key).has(key);
789
+ }
790
+ function mapCacheSet(key, value) {
791
+ var data = getMapData(this, key), size = data.size;
792
+ data.set(key, value);
793
+ this.size += data.size == size ? 0 : 1;
794
+ return this;
795
+ }
796
+ function MapCache(entries) {
797
+ var index2 = -1, length = entries == null ? 0 : entries.length;
798
+ this.clear();
799
+ while (++index2 < length) {
800
+ var entry = entries[index2];
801
+ this.set(entry[0], entry[1]);
802
+ }
803
+ }
804
+ MapCache.prototype.clear = mapCacheClear;
805
+ MapCache.prototype["delete"] = mapCacheDelete;
806
+ MapCache.prototype.get = mapCacheGet;
807
+ MapCache.prototype.has = mapCacheHas;
808
+ MapCache.prototype.set = mapCacheSet;
809
+ var FUNC_ERROR_TEXT$2 = "Expected a function";
810
+ function memoize(func, resolver) {
811
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
812
+ throw new TypeError(FUNC_ERROR_TEXT$2);
813
+ }
814
+ var memoized = function() {
815
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
816
+ if (cache.has(key)) {
817
+ return cache.get(key);
818
+ }
819
+ var result = func.apply(this, args);
820
+ memoized.cache = cache.set(key, result) || cache;
821
+ return result;
822
+ };
823
+ memoized.cache = new (memoize.Cache || MapCache)();
824
+ return memoized;
825
+ }
826
+ memoize.Cache = MapCache;
827
+ var MAX_MEMOIZE_SIZE = 500;
828
+ function memoizeCapped(func) {
829
+ var result = memoize(func, function(key) {
830
+ if (cache.size === MAX_MEMOIZE_SIZE) {
831
+ cache.clear();
832
+ }
833
+ return key;
834
+ });
835
+ var cache = result.cache;
836
+ return result;
837
+ }
838
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
839
+ var reEscapeChar = /\\(\\)?/g;
840
+ var stringToPath = memoizeCapped(function(string) {
841
+ var result = [];
842
+ if (string.charCodeAt(0) === 46) {
843
+ result.push("");
844
+ }
845
+ string.replace(rePropName, function(match, number, quote, subString) {
846
+ result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
847
+ });
848
+ return result;
849
+ });
850
+ var stringToPath$1 = stringToPath;
851
+ function toString(value) {
852
+ return value == null ? "" : baseToString(value);
853
+ }
854
+ function castPath(value, object) {
855
+ if (isArray$1(value)) {
856
+ return value;
857
+ }
858
+ return isKey(value, object) ? [value] : stringToPath$1(toString(value));
859
+ }
860
+ var INFINITY = 1 / 0;
861
+ function toKey(value) {
862
+ if (typeof value == "string" || isSymbol(value)) {
863
+ return value;
864
+ }
865
+ var result = value + "";
866
+ return result == "0" && 1 / value == -INFINITY ? "-0" : result;
867
+ }
868
+ function baseGet(object, path) {
869
+ path = castPath(path, object);
870
+ var index2 = 0, length = path.length;
871
+ while (object != null && index2 < length) {
872
+ object = object[toKey(path[index2++])];
873
+ }
874
+ return index2 && index2 == length ? object : void 0;
875
+ }
876
+ function arrayPush(array, values) {
877
+ var index2 = -1, length = values.length, offset = array.length;
878
+ while (++index2 < length) {
879
+ array[offset + index2] = values[index2];
880
+ }
881
+ return array;
882
+ }
883
+ var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0;
884
+ function isFlattenable(value) {
885
+ return isArray$1(value) || isArguments$1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
886
+ }
887
+ function baseFlatten(array, depth, predicate, isStrict, result) {
888
+ var index2 = -1, length = array.length;
889
+ predicate || (predicate = isFlattenable);
890
+ result || (result = []);
891
+ while (++index2 < length) {
892
+ var value = array[index2];
893
+ if (depth > 0 && predicate(value)) {
894
+ if (depth > 1) {
895
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
896
+ } else {
897
+ arrayPush(result, value);
898
+ }
899
+ } else if (!isStrict) {
900
+ result[result.length] = value;
901
+ }
902
+ }
903
+ return result;
904
+ }
905
+ function flatten(array) {
906
+ var length = array == null ? 0 : array.length;
907
+ return length ? baseFlatten(array, 1) : [];
908
+ }
909
+ function flatRest(func) {
910
+ return setToString$1(overRest(func, void 0, flatten), func + "");
911
+ }
912
+ var getPrototype = overArg(Object.getPrototypeOf, Object);
913
+ var getPrototype$1 = getPrototype;
914
+ var objectTag$3 = "[object Object]";
915
+ var funcProto = Function.prototype, objectProto$4 = Object.prototype;
916
+ var funcToString = funcProto.toString;
917
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
918
+ var objectCtorString = funcToString.call(Object);
919
+ function isPlainObject(value) {
920
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
921
+ return false;
922
+ }
923
+ var proto = getPrototype$1(value);
924
+ if (proto === null) {
925
+ return true;
926
+ }
927
+ var Ctor = hasOwnProperty$3.call(proto, "constructor") && proto.constructor;
928
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
929
+ }
930
+ function baseSlice(array, start, end) {
931
+ var index2 = -1, length = array.length;
932
+ if (start < 0) {
933
+ start = -start > length ? 0 : length + start;
934
+ }
935
+ end = end > length ? length : end;
936
+ if (end < 0) {
937
+ end += length;
938
+ }
939
+ length = start > end ? 0 : end - start >>> 0;
940
+ start >>>= 0;
941
+ var result = Array(length);
942
+ while (++index2 < length) {
943
+ result[index2] = array[index2 + start];
944
+ }
945
+ return result;
946
+ }
947
+ function stackClear() {
948
+ this.__data__ = new ListCache();
949
+ this.size = 0;
950
+ }
951
+ function stackDelete(key) {
952
+ var data = this.__data__, result = data["delete"](key);
953
+ this.size = data.size;
954
+ return result;
955
+ }
956
+ function stackGet(key) {
957
+ return this.__data__.get(key);
958
+ }
959
+ function stackHas(key) {
960
+ return this.__data__.has(key);
961
+ }
962
+ var LARGE_ARRAY_SIZE = 200;
963
+ function stackSet(key, value) {
964
+ var data = this.__data__;
965
+ if (data instanceof ListCache) {
966
+ var pairs = data.__data__;
967
+ if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
968
+ pairs.push([key, value]);
969
+ this.size = ++data.size;
970
+ return this;
971
+ }
972
+ data = this.__data__ = new MapCache(pairs);
973
+ }
974
+ data.set(key, value);
975
+ this.size = data.size;
976
+ return this;
977
+ }
978
+ function Stack(entries) {
979
+ var data = this.__data__ = new ListCache(entries);
980
+ this.size = data.size;
981
+ }
982
+ Stack.prototype.clear = stackClear;
983
+ Stack.prototype["delete"] = stackDelete;
984
+ Stack.prototype.get = stackGet;
985
+ Stack.prototype.has = stackHas;
986
+ Stack.prototype.set = stackSet;
987
+ function baseAssign(object, source) {
988
+ return object && copyObject(source, keys(source), object);
989
+ }
990
+ function baseAssignIn(object, source) {
991
+ return object && copyObject(source, keysIn(source), object);
992
+ }
993
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
994
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
995
+ var moduleExports = freeModule && freeModule.exports === freeExports;
996
+ var Buffer2 = moduleExports ? root$1.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
997
+ function cloneBuffer(buffer, isDeep) {
998
+ if (isDeep) {
999
+ return buffer.slice();
1000
+ }
1001
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1002
+ buffer.copy(result);
1003
+ return result;
1004
+ }
1005
+ function arrayFilter(array, predicate) {
1006
+ var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
1007
+ while (++index2 < length) {
1008
+ var value = array[index2];
1009
+ if (predicate(value, index2, array)) {
1010
+ result[resIndex++] = value;
1011
+ }
1012
+ }
1013
+ return result;
1014
+ }
1015
+ function stubArray() {
1016
+ return [];
1017
+ }
1018
+ var objectProto$3 = Object.prototype;
1019
+ var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
1020
+ var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1021
+ var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
1022
+ if (object == null) {
1023
+ return [];
1024
+ }
1025
+ object = Object(object);
1026
+ return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1027
+ return propertyIsEnumerable.call(object, symbol);
1028
+ });
1029
+ };
1030
+ var getSymbols$1 = getSymbols;
1031
+ function copySymbols(source, object) {
1032
+ return copyObject(source, getSymbols$1(source), object);
1033
+ }
1034
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
1035
+ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
1036
+ var result = [];
1037
+ while (object) {
1038
+ arrayPush(result, getSymbols$1(object));
1039
+ object = getPrototype$1(object);
1040
+ }
1041
+ return result;
1042
+ };
1043
+ var getSymbolsIn$1 = getSymbolsIn;
1044
+ function copySymbolsIn(source, object) {
1045
+ return copyObject(source, getSymbolsIn$1(source), object);
1046
+ }
1047
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1048
+ var result = keysFunc(object);
1049
+ return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
1050
+ }
1051
+ function getAllKeys(object) {
1052
+ return baseGetAllKeys(object, keys, getSymbols$1);
1053
+ }
1054
+ function getAllKeysIn(object) {
1055
+ return baseGetAllKeys(object, keysIn, getSymbolsIn$1);
1056
+ }
1057
+ var DataView = getNative(root$1, "DataView");
1058
+ var DataView$1 = DataView;
1059
+ var Promise$1 = getNative(root$1, "Promise");
1060
+ var Promise$2 = Promise$1;
1061
+ var Set = getNative(root$1, "Set");
1062
+ var Set$1 = Set;
1063
+ var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
1064
+ var dataViewTag$3 = "[object DataView]";
1065
+ var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
1066
+ var getTag = baseGetTag;
1067
+ if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) {
1068
+ getTag = function(value) {
1069
+ var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
1070
+ if (ctorString) {
1071
+ switch (ctorString) {
1072
+ case dataViewCtorString:
1073
+ return dataViewTag$3;
1074
+ case mapCtorString:
1075
+ return mapTag$4;
1076
+ case promiseCtorString:
1077
+ return promiseTag;
1078
+ case setCtorString:
1079
+ return setTag$4;
1080
+ case weakMapCtorString:
1081
+ return weakMapTag$1;
1082
+ }
1083
+ }
1084
+ return result;
1085
+ };
1086
+ }
1087
+ var getTag$1 = getTag;
1088
+ var objectProto$2 = Object.prototype;
1089
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
1090
+ function initCloneArray(array) {
1091
+ var length = array.length, result = new array.constructor(length);
1092
+ if (length && typeof array[0] == "string" && hasOwnProperty$2.call(array, "index")) {
1093
+ result.index = array.index;
1094
+ result.input = array.input;
1095
+ }
1096
+ return result;
1097
+ }
1098
+ var Uint8Array2 = root$1.Uint8Array;
1099
+ var Uint8Array$1 = Uint8Array2;
1100
+ function cloneArrayBuffer(arrayBuffer) {
1101
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1102
+ new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
1103
+ return result;
1104
+ }
1105
+ function cloneDataView(dataView, isDeep) {
1106
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
1107
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
1108
+ }
1109
+ var reFlags = /\w*$/;
1110
+ function cloneRegExp(regexp) {
1111
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
1112
+ result.lastIndex = regexp.lastIndex;
1113
+ return result;
1114
+ }
1115
+ var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
1116
+ function cloneSymbol(symbol) {
1117
+ return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
1118
+ }
1119
+ function cloneTypedArray(typedArray, isDeep) {
1120
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1121
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1122
+ }
1123
+ var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
1124
+ var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
1125
+ function initCloneByTag(object, tag, isDeep) {
1126
+ var Ctor = object.constructor;
1127
+ switch (tag) {
1128
+ case arrayBufferTag$2:
1129
+ return cloneArrayBuffer(object);
1130
+ case boolTag$2:
1131
+ case dateTag$2:
1132
+ return new Ctor(+object);
1133
+ case dataViewTag$2:
1134
+ return cloneDataView(object, isDeep);
1135
+ case float32Tag$1:
1136
+ case float64Tag$1:
1137
+ case int8Tag$1:
1138
+ case int16Tag$1:
1139
+ case int32Tag$1:
1140
+ case uint8Tag$1:
1141
+ case uint8ClampedTag$1:
1142
+ case uint16Tag$1:
1143
+ case uint32Tag$1:
1144
+ return cloneTypedArray(object, isDeep);
1145
+ case mapTag$3:
1146
+ return new Ctor();
1147
+ case numberTag$2:
1148
+ case stringTag$2:
1149
+ return new Ctor(object);
1150
+ case regexpTag$2:
1151
+ return cloneRegExp(object);
1152
+ case setTag$3:
1153
+ return new Ctor();
1154
+ case symbolTag$2:
1155
+ return cloneSymbol(object);
1156
+ }
1157
+ }
1158
+ function initCloneObject(object) {
1159
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate$1(getPrototype$1(object)) : {};
1160
+ }
1161
+ var mapTag$2 = "[object Map]";
1162
+ function baseIsMap(value) {
1163
+ return isObjectLike(value) && getTag$1(value) == mapTag$2;
1164
+ }
1165
+ var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
1166
+ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
1167
+ var isMap$1 = isMap;
1168
+ var setTag$2 = "[object Set]";
1169
+ function baseIsSet(value) {
1170
+ return isObjectLike(value) && getTag$1(value) == setTag$2;
1171
+ }
1172
+ var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet;
1173
+ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
1174
+ var isSet$1 = isSet;
1175
+ var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
1176
+ var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
1177
+ var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
1178
+ var cloneableTags = {};
1179
+ cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1180
+ cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
1181
+ function baseClone(value, bitmask, customizer, key, object, stack) {
1182
+ var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
1183
+ if (customizer) {
1184
+ result = object ? customizer(value, key, object, stack) : customizer(value);
1185
+ }
1186
+ if (result !== void 0) {
1187
+ return result;
1188
+ }
1189
+ if (!isObject(value)) {
1190
+ return value;
1191
+ }
1192
+ var isArr = isArray$1(value);
1193
+ if (isArr) {
1194
+ result = initCloneArray(value);
1195
+ if (!isDeep) {
1196
+ return copyArray(value, result);
1197
+ }
1198
+ } else {
1199
+ var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
1200
+ if (isBuffer$1(value)) {
1201
+ return cloneBuffer(value, isDeep);
1202
+ }
1203
+ if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
1204
+ result = isFlat || isFunc ? {} : initCloneObject(value);
1205
+ if (!isDeep) {
1206
+ return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
1207
+ }
1208
+ } else {
1209
+ if (!cloneableTags[tag]) {
1210
+ return object ? value : {};
1211
+ }
1212
+ result = initCloneByTag(value, tag, isDeep);
1213
+ }
1214
+ }
1215
+ stack || (stack = new Stack());
1216
+ var stacked = stack.get(value);
1217
+ if (stacked) {
1218
+ return stacked;
1219
+ }
1220
+ stack.set(value, result);
1221
+ if (isSet$1(value)) {
1222
+ value.forEach(function(subValue) {
1223
+ result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
1224
+ });
1225
+ } else if (isMap$1(value)) {
1226
+ value.forEach(function(subValue, key2) {
1227
+ result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
1228
+ });
1229
+ }
1230
+ var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
1231
+ var props = isArr ? void 0 : keysFunc(value);
1232
+ arrayEach(props || value, function(subValue, key2) {
1233
+ if (props) {
1234
+ key2 = subValue;
1235
+ subValue = value[key2];
1236
+ }
1237
+ assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
1238
+ });
1239
+ return result;
1240
+ }
1241
+ var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
1242
+ function cloneDeep(value) {
1243
+ return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
1244
+ }
1245
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1246
+ function setCacheAdd(value) {
1247
+ this.__data__.set(value, HASH_UNDEFINED);
1248
+ return this;
1249
+ }
1250
+ function setCacheHas(value) {
1251
+ return this.__data__.has(value);
1252
+ }
1253
+ function SetCache(values) {
1254
+ var index2 = -1, length = values == null ? 0 : values.length;
1255
+ this.__data__ = new MapCache();
1256
+ while (++index2 < length) {
1257
+ this.add(values[index2]);
1258
+ }
1259
+ }
1260
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1261
+ SetCache.prototype.has = setCacheHas;
1262
+ function arraySome(array, predicate) {
1263
+ var index2 = -1, length = array == null ? 0 : array.length;
1264
+ while (++index2 < length) {
1265
+ if (predicate(array[index2], index2, array)) {
1266
+ return true;
1267
+ }
1268
+ }
1269
+ return false;
1270
+ }
1271
+ function cacheHas(cache, key) {
1272
+ return cache.has(key);
1273
+ }
1274
+ var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
1275
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1276
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
1277
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1278
+ return false;
1279
+ }
1280
+ var arrStacked = stack.get(array);
1281
+ var othStacked = stack.get(other);
1282
+ if (arrStacked && othStacked) {
1283
+ return arrStacked == other && othStacked == array;
1284
+ }
1285
+ var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
1286
+ stack.set(array, other);
1287
+ stack.set(other, array);
1288
+ while (++index2 < arrLength) {
1289
+ var arrValue = array[index2], othValue = other[index2];
1290
+ if (customizer) {
1291
+ var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
1292
+ }
1293
+ if (compared !== void 0) {
1294
+ if (compared) {
1295
+ continue;
1296
+ }
1297
+ result = false;
1298
+ break;
1299
+ }
1300
+ if (seen) {
1301
+ if (!arraySome(other, function(othValue2, othIndex) {
1302
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
1303
+ return seen.push(othIndex);
1304
+ }
1305
+ })) {
1306
+ result = false;
1307
+ break;
1308
+ }
1309
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1310
+ result = false;
1311
+ break;
1312
+ }
1313
+ }
1314
+ stack["delete"](array);
1315
+ stack["delete"](other);
1316
+ return result;
1317
+ }
1318
+ function mapToArray(map) {
1319
+ var index2 = -1, result = Array(map.size);
1320
+ map.forEach(function(value, key) {
1321
+ result[++index2] = [key, value];
1322
+ });
1323
+ return result;
1324
+ }
1325
+ function setToArray(set) {
1326
+ var index2 = -1, result = Array(set.size);
1327
+ set.forEach(function(value) {
1328
+ result[++index2] = value;
1329
+ });
1330
+ return result;
1331
+ }
1332
+ var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
1333
+ var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
1334
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
1335
+ var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
1336
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1337
+ switch (tag) {
1338
+ case dataViewTag:
1339
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
1340
+ return false;
1341
+ }
1342
+ object = object.buffer;
1343
+ other = other.buffer;
1344
+ case arrayBufferTag:
1345
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
1346
+ return false;
1347
+ }
1348
+ return true;
1349
+ case boolTag:
1350
+ case dateTag:
1351
+ case numberTag:
1352
+ return eq(+object, +other);
1353
+ case errorTag:
1354
+ return object.name == other.name && object.message == other.message;
1355
+ case regexpTag:
1356
+ case stringTag:
1357
+ return object == other + "";
1358
+ case mapTag:
1359
+ var convert = mapToArray;
1360
+ case setTag:
1361
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
1362
+ convert || (convert = setToArray);
1363
+ if (object.size != other.size && !isPartial) {
1364
+ return false;
1365
+ }
1366
+ var stacked = stack.get(object);
1367
+ if (stacked) {
1368
+ return stacked == other;
1369
+ }
1370
+ bitmask |= COMPARE_UNORDERED_FLAG;
1371
+ stack.set(object, other);
1372
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1373
+ stack["delete"](object);
1374
+ return result;
1375
+ case symbolTag:
1376
+ if (symbolValueOf) {
1377
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1378
+ }
1379
+ }
1380
+ return false;
1381
+ }
1382
+ var COMPARE_PARTIAL_FLAG$1 = 1;
1383
+ var objectProto$1 = Object.prototype;
1384
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1385
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1386
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
1387
+ if (objLength != othLength && !isPartial) {
1388
+ return false;
1389
+ }
1390
+ var index2 = objLength;
1391
+ while (index2--) {
1392
+ var key = objProps[index2];
1393
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
1394
+ return false;
1395
+ }
1396
+ }
1397
+ var objStacked = stack.get(object);
1398
+ var othStacked = stack.get(other);
1399
+ if (objStacked && othStacked) {
1400
+ return objStacked == other && othStacked == object;
1401
+ }
1402
+ var result = true;
1403
+ stack.set(object, other);
1404
+ stack.set(other, object);
1405
+ var skipCtor = isPartial;
1406
+ while (++index2 < objLength) {
1407
+ key = objProps[index2];
1408
+ var objValue = object[key], othValue = other[key];
1409
+ if (customizer) {
1410
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
1411
+ }
1412
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
1413
+ result = false;
1414
+ break;
1415
+ }
1416
+ skipCtor || (skipCtor = key == "constructor");
1417
+ }
1418
+ if (result && !skipCtor) {
1419
+ var objCtor = object.constructor, othCtor = other.constructor;
1420
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
1421
+ result = false;
1422
+ }
1423
+ }
1424
+ stack["delete"](object);
1425
+ stack["delete"](other);
1426
+ return result;
1427
+ }
1428
+ var COMPARE_PARTIAL_FLAG = 1;
1429
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
1430
+ var objectProto = Object.prototype;
1431
+ var hasOwnProperty = objectProto.hasOwnProperty;
1432
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1433
+ var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
1434
+ objTag = objTag == argsTag ? objectTag : objTag;
1435
+ othTag = othTag == argsTag ? objectTag : othTag;
1436
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
1437
+ if (isSameTag && isBuffer$1(object)) {
1438
+ if (!isBuffer$1(other)) {
1439
+ return false;
1440
+ }
1441
+ objIsArr = true;
1442
+ objIsObj = false;
1443
+ }
1444
+ if (isSameTag && !objIsObj) {
1445
+ stack || (stack = new Stack());
1446
+ return objIsArr || isTypedArray$1(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1447
+ }
1448
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1449
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
1450
+ if (objIsWrapped || othIsWrapped) {
1451
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
1452
+ stack || (stack = new Stack());
1453
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1454
+ }
1455
+ }
1456
+ if (!isSameTag) {
1457
+ return false;
1458
+ }
1459
+ stack || (stack = new Stack());
1460
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1461
+ }
1462
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
1463
+ if (value === other) {
1464
+ return true;
1465
+ }
1466
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
1467
+ return value !== value && other !== other;
1468
+ }
1469
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1470
+ }
1471
+ function createBaseFor(fromRight) {
1472
+ return function(object, iteratee, keysFunc) {
1473
+ var index2 = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
1474
+ while (length--) {
1475
+ var key = props[fromRight ? length : ++index2];
1476
+ if (iteratee(iterable[key], key, iterable) === false) {
1477
+ break;
1478
+ }
1479
+ }
1480
+ return object;
1481
+ };
1482
+ }
1483
+ var baseFor = createBaseFor();
1484
+ var baseFor$1 = baseFor;
1485
+ var now = function() {
1486
+ return root$1.Date.now();
1487
+ };
1488
+ var now$1 = now;
1489
+ var FUNC_ERROR_TEXT$1 = "Expected a function";
1490
+ var nativeMax = Math.max, nativeMin = Math.min;
1491
+ function debounce(func, wait, options) {
1492
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
1493
+ if (typeof func != "function") {
1494
+ throw new TypeError(FUNC_ERROR_TEXT$1);
1495
+ }
1496
+ wait = toNumber(wait) || 0;
1497
+ if (isObject(options)) {
1498
+ leading = !!options.leading;
1499
+ maxing = "maxWait" in options;
1500
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
1501
+ trailing = "trailing" in options ? !!options.trailing : trailing;
1502
+ }
1503
+ function invokeFunc(time) {
1504
+ var args = lastArgs, thisArg = lastThis;
1505
+ lastArgs = lastThis = void 0;
1506
+ lastInvokeTime = time;
1507
+ result = func.apply(thisArg, args);
1508
+ return result;
1509
+ }
1510
+ function leadingEdge(time) {
1511
+ lastInvokeTime = time;
1512
+ timerId = setTimeout(timerExpired, wait);
1513
+ return leading ? invokeFunc(time) : result;
1514
+ }
1515
+ function remainingWait(time) {
1516
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
1517
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
1518
+ }
1519
+ function shouldInvoke(time) {
1520
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
1521
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
1522
+ }
1523
+ function timerExpired() {
1524
+ var time = now$1();
1525
+ if (shouldInvoke(time)) {
1526
+ return trailingEdge(time);
1527
+ }
1528
+ timerId = setTimeout(timerExpired, remainingWait(time));
1529
+ }
1530
+ function trailingEdge(time) {
1531
+ timerId = void 0;
1532
+ if (trailing && lastArgs) {
1533
+ return invokeFunc(time);
1534
+ }
1535
+ lastArgs = lastThis = void 0;
1536
+ return result;
1537
+ }
1538
+ function cancel() {
1539
+ if (timerId !== void 0) {
1540
+ clearTimeout(timerId);
1541
+ }
1542
+ lastInvokeTime = 0;
1543
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
1544
+ }
1545
+ function flush() {
1546
+ return timerId === void 0 ? result : trailingEdge(now$1());
1547
+ }
1548
+ function debounced() {
1549
+ var time = now$1(), isInvoking = shouldInvoke(time);
1550
+ lastArgs = arguments;
1551
+ lastThis = this;
1552
+ lastCallTime = time;
1553
+ if (isInvoking) {
1554
+ if (timerId === void 0) {
1555
+ return leadingEdge(lastCallTime);
1556
+ }
1557
+ if (maxing) {
1558
+ clearTimeout(timerId);
1559
+ timerId = setTimeout(timerExpired, wait);
1560
+ return invokeFunc(lastCallTime);
1561
+ }
1562
+ }
1563
+ if (timerId === void 0) {
1564
+ timerId = setTimeout(timerExpired, wait);
1565
+ }
1566
+ return result;
1567
+ }
1568
+ debounced.cancel = cancel;
1569
+ debounced.flush = flush;
1570
+ return debounced;
1571
+ }
1572
+ function assignMergeValue(object, key, value) {
1573
+ if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
1574
+ baseAssignValue(object, key, value);
1575
+ }
1576
+ }
1577
+ function isArrayLikeObject(value) {
1578
+ return isObjectLike(value) && isArrayLike(value);
1579
+ }
1580
+ function safeGet(object, key) {
1581
+ if (key === "constructor" && typeof object[key] === "function") {
1582
+ return;
1583
+ }
1584
+ if (key == "__proto__") {
1585
+ return;
1586
+ }
1587
+ return object[key];
1588
+ }
1589
+ function toPlainObject(value) {
1590
+ return copyObject(value, keysIn(value));
1591
+ }
1592
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1593
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
1594
+ if (stacked) {
1595
+ assignMergeValue(object, key, stacked);
1596
+ return;
1597
+ }
1598
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
1599
+ var isCommon = newValue === void 0;
1600
+ if (isCommon) {
1601
+ var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$1(srcValue);
1602
+ newValue = srcValue;
1603
+ if (isArr || isBuff || isTyped) {
1604
+ if (isArray$1(objValue)) {
1605
+ newValue = objValue;
1606
+ } else if (isArrayLikeObject(objValue)) {
1607
+ newValue = copyArray(objValue);
1608
+ } else if (isBuff) {
1609
+ isCommon = false;
1610
+ newValue = cloneBuffer(srcValue, true);
1611
+ } else if (isTyped) {
1612
+ isCommon = false;
1613
+ newValue = cloneTypedArray(srcValue, true);
1614
+ } else {
1615
+ newValue = [];
1616
+ }
1617
+ } else if (isPlainObject(srcValue) || isArguments$1(srcValue)) {
1618
+ newValue = objValue;
1619
+ if (isArguments$1(objValue)) {
1620
+ newValue = toPlainObject(objValue);
1621
+ } else if (!isObject(objValue) || isFunction(objValue)) {
1622
+ newValue = initCloneObject(srcValue);
1623
+ }
1624
+ } else {
1625
+ isCommon = false;
1626
+ }
1627
+ }
1628
+ if (isCommon) {
1629
+ stack.set(srcValue, newValue);
1630
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1631
+ stack["delete"](srcValue);
1632
+ }
1633
+ assignMergeValue(object, key, newValue);
1634
+ }
1635
+ function baseMerge(object, source, srcIndex, customizer, stack) {
1636
+ if (object === source) {
1637
+ return;
1638
+ }
1639
+ baseFor$1(source, function(srcValue, key) {
1640
+ stack || (stack = new Stack());
1641
+ if (isObject(srcValue)) {
1642
+ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1643
+ } else {
1644
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
1645
+ if (newValue === void 0) {
1646
+ newValue = srcValue;
1647
+ }
1648
+ assignMergeValue(object, key, newValue);
1649
+ }
1650
+ }, keysIn);
1651
+ }
1652
+ function last(array) {
1653
+ var length = array == null ? 0 : array.length;
1654
+ return length ? array[length - 1] : void 0;
1655
+ }
1656
+ function parent(object, path) {
1657
+ return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
1658
+ }
1659
+ function isEqual(value, other) {
1660
+ return baseIsEqual(value, other);
1661
+ }
1662
+ var merge = createAssigner(function(object, source, srcIndex) {
1663
+ baseMerge(object, source, srcIndex);
1664
+ });
1665
+ var merge$1 = merge;
1666
+ function baseUnset(object, path) {
1667
+ path = castPath(path, object);
1668
+ object = parent(object, path);
1669
+ return object == null || delete object[toKey(last(path))];
1670
+ }
1671
+ function customOmitClone(value) {
1672
+ return isPlainObject(value) ? void 0 : value;
1673
+ }
1674
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
1675
+ var omit = flatRest(function(object, paths) {
1676
+ var result = {};
1677
+ if (object == null) {
1678
+ return result;
1679
+ }
1680
+ var isDeep = false;
1681
+ paths = arrayMap(paths, function(path) {
1682
+ path = castPath(path, object);
1683
+ isDeep || (isDeep = path.length > 1);
1684
+ return path;
1685
+ });
1686
+ copyObject(object, getAllKeysIn(object), result);
1687
+ if (isDeep) {
1688
+ result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
1689
+ }
1690
+ var length = paths.length;
1691
+ while (length--) {
1692
+ baseUnset(result, paths[length]);
1693
+ }
1694
+ return result;
1695
+ });
1696
+ var omit$1 = omit;
1697
+ var FUNC_ERROR_TEXT = "Expected a function";
1698
+ function throttle(func, wait, options) {
1699
+ var leading = true, trailing = true;
1700
+ if (typeof func != "function") {
1701
+ throw new TypeError(FUNC_ERROR_TEXT);
1702
+ }
1703
+ if (isObject(options)) {
1704
+ leading = "leading" in options ? !!options.leading : leading;
1705
+ trailing = "trailing" in options ? !!options.trailing : trailing;
1706
+ }
1707
+ return debounce(func, wait, {
1708
+ "leading": leading,
1709
+ "maxWait": wait,
1710
+ "trailing": trailing
1711
+ });
1712
+ }
1713
+ function useToastConstant() {
1714
+ const ANIMATION_NAME2 = "slide-in";
1715
+ const ANIMATION_TIME2 = 300;
1716
+ const ID_PREFIX2 = "toast-message";
1717
+ return {
1718
+ ANIMATION_TIME: ANIMATION_TIME2,
1719
+ ANIMATION_NAME: ANIMATION_NAME2,
1720
+ ID_PREFIX: ID_PREFIX2
1721
+ };
1722
+ }
1723
+ const { ANIMATION_TIME: ANIMATION_TIME$1 } = useToastConstant();
1724
+ function useToastEvent() {
1725
+ const ctx = getCurrentInstance();
1726
+ function onCloseEvent(msg) {
1727
+ ctx.emit("closeEvent", msg);
1728
+ }
1729
+ function onValueChange(msgs) {
1730
+ ctx.emit("valueChange", msgs);
1731
+ }
1732
+ function onHidden() {
1733
+ setTimeout(() => {
1734
+ var _a, _b;
1735
+ return (_b = (_a = ctx.attrs).onHidden) == null ? void 0 : _b.call(_a);
1736
+ }, ANIMATION_TIME$1);
1737
+ }
1738
+ return { onCloseEvent, onValueChange, onHidden };
1739
+ }
1740
+ function useToastHelper() {
1741
+ function severityDelay(msg) {
1742
+ switch (msg.severity) {
1743
+ case "warning":
1744
+ case "error":
1745
+ return 1e4;
1746
+ default:
1747
+ return 5e3;
1748
+ }
1749
+ }
1750
+ return { severityDelay };
1751
+ }
1752
+ let toastZIndex = 1060;
1753
+ function toastIncrease() {
1754
+ toastZIndex++;
1755
+ }
1756
+ const {
1757
+ ANIMATION_NAME,
1758
+ ANIMATION_TIME,
1759
+ ID_PREFIX
1760
+ } = useToastConstant();
1761
+ var Toast = defineComponent({
1762
+ name: "DToast",
1763
+ inheritAttrs: false,
1764
+ props: toastProps,
1765
+ emits: ["closeEvent", "valueChange"],
1766
+ setup(props, ctx) {
1767
+ const {
1768
+ onCloseEvent,
1769
+ onHidden,
1770
+ onValueChange
1771
+ } = useToastEvent();
1772
+ const {
1773
+ severityDelay
1774
+ } = useToastHelper();
1775
+ const removeThrottle = throttle(remove, ANIMATION_TIME);
1776
+ const messages = ref([]);
1777
+ const msgAnimations = ref([]);
1778
+ const containerRef = ref();
1779
+ const msgItemRefs = ref([]);
1780
+ let timestamp = Date.now();
1781
+ let timeout;
1782
+ const timeoutArr = [];
1783
+ const defaultLife = computed(() => {
1784
+ if (props.life !== null)
1785
+ return props.life;
1786
+ if (messages.value.length > 0)
1787
+ return severityDelay(messages.value[0]);
1788
+ return 5e3;
1789
+ });
1790
+ watch(() => props.value, (value) => {
1791
+ if (value.length === 0)
1792
+ return;
1793
+ if (hasMsgAnimation()) {
1794
+ initValue();
1795
+ }
1796
+ nextTick(() => {
1797
+ initValue(value);
1798
+ handleValueChange();
1799
+ });
1800
+ }, {
1801
+ deep: true,
1802
+ immediate: true
1803
+ });
1804
+ watch(messages, (value) => {
1805
+ value.length === 0 && msgAnimations.value.length > 0 && (msgAnimations.value = []);
1806
+ });
1807
+ watch(msgAnimations, (value, oldValue) => {
1808
+ oldValue.length > 0 && value.length === 0 && onHidden();
1809
+ });
1810
+ onUnmounted(() => {
1811
+ if (props.sticky) {
1812
+ return;
1813
+ }
1814
+ if (props.lifeMode === "single") {
1815
+ timeoutArr.forEach((t) => t && clearTimeout(t));
1816
+ } else {
1817
+ clearTimeout(timeout);
1818
+ }
1819
+ });
1820
+ function initValue(value = []) {
1821
+ const cloneValue = cloneDeep(value);
1822
+ messages.value = cloneValue.map((v, i) => merge$1(v, {
1823
+ id: `${ID_PREFIX}-${i}`
1824
+ }));
1825
+ msgAnimations.value = [];
1826
+ }
1827
+ function handleValueChange() {
1828
+ toastIncrease();
1829
+ setTimeout(() => {
1830
+ messages.value.forEach((msg) => msgAnimations.value.push(msg));
1831
+ }, 0);
1832
+ if (props.sticky)
1833
+ return;
1834
+ if (timeout) {
1835
+ timeout = clearTimeout(timeout);
1836
+ }
1837
+ if (timeoutArr.length > 0) {
1838
+ timeoutArr.splice(0).forEach((t) => clearTimeout(t));
1839
+ }
1840
+ timestamp = Date.now();
1841
+ if (props.lifeMode === "single") {
1842
+ setTimeout(() => {
1843
+ messages.value.forEach((msg, i) => {
1844
+ timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), msg.life || severityDelay(msg));
1845
+ });
1846
+ });
1847
+ } else {
1848
+ timeout = setTimeout(() => removeAll(), defaultLife.value);
1849
+ }
1850
+ }
1851
+ function singleModeRemove(msg, i) {
1852
+ removeMsgAnimation(msg);
1853
+ setTimeout(() => {
1854
+ onCloseEvent(msg);
1855
+ if (hasMsgAnimation()) {
1856
+ messages.value.splice(i, 1);
1857
+ } else {
1858
+ messages.value = [];
1859
+ }
1860
+ onValueChange(messages.value);
1861
+ }, ANIMATION_TIME);
1862
+ }
1863
+ function interrupt(i) {
1864
+ if (!msgAnimations.value.includes(messages.value[i]))
1865
+ return;
1866
+ if (props.lifeMode === "single") {
1867
+ if (timeoutArr[i]) {
1868
+ timeoutArr[i] = clearTimeout(timeoutArr[i]);
1869
+ }
1870
+ } else {
1871
+ resetDelay(() => {
1872
+ messages.value.forEach((msg, _i) => i !== _i && removeMsgAnimation(msg));
1873
+ });
1874
+ }
1875
+ }
1876
+ function resetDelay(fn) {
1877
+ if (!props.sticky && timeout) {
1878
+ timeout = clearTimeout(timeout);
1879
+ const remainTime = defaultLife.value - (Date.now() - timestamp);
1880
+ timeout = setTimeout(() => fn(), remainTime);
1881
+ }
1882
+ }
1883
+ function remove(i) {
1884
+ if (props.lifeMode === "single" && timeoutArr[i]) {
1885
+ timeoutArr[i] = clearTimeout(timeoutArr[i]);
1886
+ timeoutArr.splice(i, 1);
1887
+ }
1888
+ removeMsgAnimation(messages.value[i]);
1889
+ setTimeout(() => {
1890
+ onCloseEvent(messages.value[i]);
1891
+ messages.value.splice(i, 1);
1892
+ onValueChange(messages.value);
1893
+ if (props.lifeMode === "global") {
1894
+ removeReset();
1895
+ }
1896
+ }, ANIMATION_TIME);
1897
+ }
1898
+ function removeAll() {
1899
+ if (messages.value.length > 0) {
1900
+ msgAnimations.value = [];
1901
+ setTimeout(() => {
1902
+ messages.value.forEach((msg) => onCloseEvent(msg));
1903
+ messages.value = [];
1904
+ onValueChange(messages.value);
1905
+ }, ANIMATION_TIME);
1906
+ }
1907
+ }
1908
+ function removeReset(i, msg) {
1909
+ const removed = messages.value.findIndex((_msg) => _msg === msg) === -1;
1910
+ if (removed || msg !== void 0 && !msgAnimations.value.includes(msg)) {
1911
+ return;
1912
+ }
1913
+ if (props.lifeMode === "single") {
1914
+ const msgLife = msg.life || severityDelay(msg);
1915
+ const remainTime = msgLife - (Date.now() - timestamp);
1916
+ timeoutArr[i] = setTimeout(() => singleModeRemove(msg, i), remainTime);
1917
+ } else {
1918
+ resetDelay(() => removeAll());
1919
+ }
1920
+ }
1921
+ function removeIndexThrottle(i) {
1922
+ if (i < msgItemRefs.value.length && i > -1) {
1923
+ removeThrottle(i);
1924
+ }
1925
+ }
1926
+ function removeMsgThrottle(msg) {
1927
+ const ignoreDiffKeys = ["id"];
1928
+ const index2 = messages.value.findIndex((_msg) => isEqual(omit$1(_msg, ignoreDiffKeys), omit$1(msg, ignoreDiffKeys)));
1929
+ removeIndexThrottle(index2);
1930
+ }
1931
+ function removeMsgAnimation(msg) {
1932
+ msgAnimations.value = msgAnimations.value.filter((_msg) => _msg !== msg);
1933
+ }
1934
+ function close(params) {
1935
+ if (params === void 0) {
1936
+ return removeAll();
1937
+ }
1938
+ if (typeof params === "number") {
1939
+ removeIndexThrottle(params);
1940
+ } else {
1941
+ removeMsgThrottle(params);
1942
+ }
1943
+ }
1944
+ function msgItemRef(i) {
1945
+ return msgItemRefs.value[i];
1946
+ }
1947
+ function hasMsgAnimation() {
1948
+ return msgAnimations.value.length > 0;
1949
+ }
1950
+ return {
1951
+ messages,
1952
+ msgAnimations,
1953
+ containerRef,
1954
+ msgItemRefs,
1955
+ interrupt,
1956
+ removeReset,
1957
+ removeThrottle,
1958
+ close,
1959
+ msgItemRef
1960
+ };
1961
+ },
1962
+ render() {
1963
+ const {
1964
+ style: extraStyle,
1965
+ styleClass: extraClass,
1966
+ messages,
1967
+ msgAnimations,
1968
+ msgItemRefs,
1969
+ life,
1970
+ interrupt,
1971
+ removeReset,
1972
+ removeThrottle,
1973
+ $attrs,
1974
+ $slots
1975
+ } = this;
1976
+ const prefixCls = "devui-toast";
1977
+ const wrapperStyles = [`z-index: ${toastZIndex}`, extraStyle];
1978
+ const wrapperCls = [prefixCls, extraClass];
1979
+ const msgCls = (msg) => [`${prefixCls}-item-container`, `${prefixCls}-message-${msg.severity}`, {
1980
+ [ANIMATION_NAME]: msgAnimations.includes(msg)
1981
+ }];
1982
+ const showClose = (msg) => !(!msg.summary && life !== null);
1983
+ const showImage = (msg) => msg.severity !== "common";
1984
+ const showSummary = (msg) => !!msg.summary;
1985
+ const showContent = (msg) => !!msg.content;
1986
+ const showDetail = (msg) => !showContent(msg) && !!msg.detail;
1987
+ const msgContent = (msg) => {
1988
+ var _a;
1989
+ if (typeof msg.content === "function") {
1990
+ return msg.content(msg);
1991
+ }
1992
+ if ([null, void 0].includes(msg.content)) {
1993
+ return null;
1994
+ }
1995
+ const slotPrefix = "slot:";
1996
+ const isSlot = String(msg.content).startsWith(slotPrefix);
1997
+ if (isSlot) {
1998
+ return (_a = $slots[msg.content.slice(slotPrefix.length)]) == null ? void 0 : _a.call($slots, msg);
1999
+ }
2000
+ return msg.content;
2001
+ };
2002
+ return createVNode("div", mergeProps({
2003
+ "ref": "containerRef",
2004
+ "style": wrapperStyles,
2005
+ "class": wrapperCls
2006
+ }, $attrs), [messages.map((msg, i) => createVNode("div", {
2007
+ "ref": (el) => msgItemRefs[i] = el,
2008
+ "key": msg.id,
2009
+ "class": msgCls(msg),
2010
+ "aria-live": "polite",
2011
+ "onMouseenter": () => interrupt(i),
2012
+ "onMouseleave": () => removeReset(i, msg)
2013
+ }, [createVNode("div", {
2014
+ "class": `${prefixCls}-item`
2015
+ }, [showClose(msg) ? createVNode(ToastIconClose, {
2016
+ "prefixCls": prefixCls,
2017
+ "onClick": () => removeThrottle(i)
2018
+ }, null) : null, showImage(msg) ? createVNode(ToastImage, {
2019
+ "prefixCls": prefixCls,
2020
+ "severity": msg.severity
2021
+ }, null) : null, createVNode("div", {
2022
+ "class": "devui-toast-message"
2023
+ }, [showSummary(msg) ? createVNode("span", {
2024
+ "class": "devui-toast-title"
2025
+ }, [msg.summary]) : null, showContent(msg) ? msgContent(msg) : null, showDetail(msg) ? createVNode("p", {
2026
+ "innerHTML": msg.detail
2027
+ }, null) : null])])]))]);
2028
+ }
2029
+ });
2030
+ function createToastApp(props) {
2031
+ return createApp(Toast, props);
2032
+ }
2033
+ class ToastService {
2034
+ static open(props) {
2035
+ let $body = document.body;
2036
+ let $div = document.createElement("div");
2037
+ $body.appendChild($div);
2038
+ let app = createToastApp(__spreadProps(__spreadValues({}, props != null ? props : {}), { onHidden: () => app == null ? void 0 : app.unmount() }));
2039
+ let toastInstance = app.mount($div);
2040
+ onUnmounted(() => {
2041
+ $body.removeChild($div);
2042
+ $body = null;
2043
+ $div = null;
2044
+ app = null;
2045
+ toastInstance = null;
2046
+ }, toastInstance.$);
2047
+ return {
2048
+ toastInstance
2049
+ };
2050
+ }
2051
+ }
2052
+ Toast.install = function(app) {
2053
+ app.component(Toast.name, Toast);
2054
+ };
2055
+ var UploadStatus;
2056
+ (function(UploadStatus2) {
2057
+ UploadStatus2[UploadStatus2["preLoad"] = 0] = "preLoad";
2058
+ UploadStatus2[UploadStatus2["uploading"] = 1] = "uploading";
2059
+ UploadStatus2[UploadStatus2["uploaded"] = 2] = "uploaded";
2060
+ UploadStatus2[UploadStatus2["failed"] = 3] = "failed";
2061
+ })(UploadStatus || (UploadStatus = {}));
2062
+ const uploadProps = {
2063
+ accept: {
2064
+ type: String
2065
+ },
2066
+ webkitdirectory: {
2067
+ type: Boolean,
2068
+ default: false
2069
+ },
2070
+ uploadOptions: {
2071
+ type: Object,
2072
+ required: true
2073
+ },
2074
+ multiple: {
2075
+ type: Boolean,
2076
+ default: false
2077
+ },
2078
+ autoUpload: {
2079
+ type: Boolean,
2080
+ default: false
2081
+ },
2082
+ placeholderText: {
2083
+ type: String,
2084
+ default: "\u9009\u62E9\u6587\u4EF6"
2085
+ },
2086
+ uploadText: {
2087
+ type: String,
2088
+ default: "\u4E0A\u4F20"
2089
+ },
2090
+ uploadedFiles: {
2091
+ type: Array,
2092
+ default: () => []
2093
+ },
2094
+ withoutBtn: {
2095
+ type: Boolean,
2096
+ default: false
2097
+ },
2098
+ enableDrop: {
2099
+ type: Boolean,
2100
+ default: false
2101
+ },
2102
+ beforeUpload: {
2103
+ type: Function
2104
+ },
2105
+ dynamicUploadOptionsFn: {
2106
+ type: Function
2107
+ },
2108
+ disabled: {
2109
+ type: Boolean,
2110
+ default: false
2111
+ },
2112
+ onChange: {
2113
+ type: Function
2114
+ },
2115
+ fileDrop: {
2116
+ type: Function,
2117
+ default: void 0
2118
+ },
2119
+ fileOver: {
2120
+ type: Function,
2121
+ default: void 0
2122
+ },
2123
+ fileSelect: {
2124
+ type: Function,
2125
+ default: void 0
2126
+ },
2127
+ deleteUploadedFile: {
2128
+ type: Function,
2129
+ default: void 0
2130
+ },
2131
+ "on-error": {
2132
+ type: Function,
2133
+ default: void 0
2134
+ },
2135
+ "on-success": {
2136
+ type: Function,
2137
+ default: void 0
2138
+ },
2139
+ oneTimeUpload: {
2140
+ type: Boolean,
2141
+ default: false
2142
+ }
2143
+ };
2144
+ const getFailedFilesCount = (failedCount) => `${failedCount}\u4E2A\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01`;
2145
+ const getUploadingFilesCount = (uploadingCount, filesCount) => `${uploadingCount}/${filesCount}\u6B63\u5728\u4E0A\u4F20`;
2146
+ const getSelectedFilesCount = (filesCount) => `\u5DF2\u6DFB\u52A0${filesCount}\u4E2A\u6587\u4EF6`;
2147
+ const getAllFilesBeyondMaximalFileSizeMsg = (maximalSize) => `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
2148
+ const getBeyondMaximalFileSizeMsg = (filename, maximalSize) => {
2149
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
2150
+ };
2151
+ const getNotAllowedFileTypeMsg = (filename, scope) => {
2152
+ return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
2153
+ };
2154
+ const getExistSameNameFilesMsg = (sameNames) => {
2155
+ return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
2156
+ };
2157
+ const useSelectFiles = () => {
2158
+ const BEYOND_MAXIMAL_FILE_SIZE_MSG = ref("");
2159
+ const simulateClickEvent = (input) => {
2160
+ const evt = document.createEvent("MouseEvents");
2161
+ evt.initMouseEvent("click", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
2162
+ input.dispatchEvent(evt);
2163
+ };
2164
+ const selectFiles = ({ multiple, accept, webkitdirectory }) => {
2165
+ return new Promise((resolve) => {
2166
+ const tempNode = document.getElementById("d-upload-temp");
2167
+ if (tempNode) {
2168
+ document.body.removeChild(tempNode);
2169
+ }
2170
+ const input = document.createElement("input");
2171
+ input.style.position = "fixed";
2172
+ input.style.left = "-2000px";
2173
+ input.style.top = "-2000px";
2174
+ input.setAttribute("id", "d-upload-temp");
2175
+ input.setAttribute("type", "file");
2176
+ if (multiple) {
2177
+ input.setAttribute("multiple", "");
2178
+ }
2179
+ if (accept) {
2180
+ input.setAttribute("accept", accept);
2181
+ }
2182
+ if (webkitdirectory) {
2183
+ input.setAttribute("webkitdirectory", "");
2184
+ }
2185
+ input.addEventListener("change", (event) => {
2186
+ resolve(Array.prototype.slice.call(event.target.files));
2187
+ });
2188
+ document.body.appendChild(input);
2189
+ simulateClickEvent(input);
2190
+ });
2191
+ };
2192
+ const isAllowedFileType = (accept, file) => {
2193
+ if (accept) {
2194
+ const acceptArr = accept.split(",");
2195
+ const baseMimeType = file.type.replace(/\/.*$/, "");
2196
+ return acceptArr.some((type) => {
2197
+ const validType = type.trim();
2198
+ if (validType.startsWith(".")) {
2199
+ return file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.toLowerCase().length - validType.toLowerCase().length) > -1;
2200
+ } else if (/\/\*$/.test(validType)) {
2201
+ return baseMimeType === validType.replace(/\/.*$/, "");
2202
+ }
2203
+ return file.type === validType;
2204
+ });
2205
+ }
2206
+ return true;
2207
+ };
2208
+ const beyondMaximalSize = (fileSize, maximumSize) => {
2209
+ if (maximumSize) {
2210
+ return fileSize > 1024 * 1024 * maximumSize;
2211
+ }
2212
+ return false;
2213
+ };
2214
+ const _validateFiles = (file, accept, uploadOptions) => {
2215
+ if (!isAllowedFileType(accept, file)) {
2216
+ return {
2217
+ checkError: true,
2218
+ errorMsg: getNotAllowedFileTypeMsg(file.name, accept)
2219
+ };
2220
+ }
2221
+ if (uploadOptions && beyondMaximalSize(file.size, uploadOptions.maximumSize)) {
2222
+ return {
2223
+ checkError: true,
2224
+ errorMsg: getBeyondMaximalFileSizeMsg(file.name, uploadOptions.maximumSize)
2225
+ };
2226
+ }
2227
+ return { checkError: false, errorMsg: void 0 };
2228
+ };
2229
+ const triggerSelectFiles = (fileOptions) => {
2230
+ const { multiple, accept, webkitdirectory } = fileOptions;
2231
+ return selectFiles({ multiple, accept, webkitdirectory });
2232
+ };
2233
+ const triggerDropFiles = (files) => {
2234
+ return Promise.resolve(files);
2235
+ };
2236
+ const checkAllFilesSize = (fileSize, maximumSize) => {
2237
+ if (beyondMaximalSize(fileSize, maximumSize)) {
2238
+ BEYOND_MAXIMAL_FILE_SIZE_MSG.value = getAllFilesBeyondMaximalFileSizeMsg(maximumSize);
2239
+ return { checkError: true, errorMsg: BEYOND_MAXIMAL_FILE_SIZE_MSG.value };
2240
+ }
2241
+ };
2242
+ return {
2243
+ triggerSelectFiles,
2244
+ _validateFiles,
2245
+ triggerDropFiles,
2246
+ checkAllFilesSize
2247
+ };
2248
+ };
2249
+ class FileUploader {
2250
+ constructor(file, uploadOptions) {
2251
+ __publicField(this, "xhr");
2252
+ __publicField(this, "status");
2253
+ __publicField(this, "response");
2254
+ __publicField(this, "percentage", 0);
2255
+ this.file = file;
2256
+ this.uploadOptions = uploadOptions;
2257
+ this.file = file;
2258
+ this.uploadOptions = uploadOptions;
2259
+ this.status = UploadStatus.preLoad;
2260
+ }
2261
+ send(uploadFiles) {
2262
+ return new Promise((resolve, reject) => {
2263
+ const {
2264
+ uri,
2265
+ method,
2266
+ headers,
2267
+ authToken,
2268
+ authTokenHeader,
2269
+ additionalParameter,
2270
+ fileFieldName,
2271
+ withCredentials,
2272
+ responseType
2273
+ } = this.uploadOptions;
2274
+ const authTokenHeader_ = authTokenHeader || "Authorization";
2275
+ const fileFieldName_ = fileFieldName || "file";
2276
+ this.xhr = new XMLHttpRequest();
2277
+ this.xhr.open(method || "POST", uri);
2278
+ if (withCredentials) {
2279
+ this.xhr.withCredentials = withCredentials;
2280
+ }
2281
+ if (responseType) {
2282
+ this.xhr.responseType = responseType;
2283
+ }
2284
+ if (authToken) {
2285
+ this.xhr.setRequestHeader(authTokenHeader_, authToken);
2286
+ }
2287
+ if (headers) {
2288
+ Object.keys(headers).forEach((key) => {
2289
+ this.xhr.setRequestHeader(key, headers[key]);
2290
+ });
2291
+ }
2292
+ this.xhr.upload.onprogress = (e) => {
2293
+ this.percentage = Math.round(e.loaded * 100 / e.total);
2294
+ };
2295
+ const formData = uploadFiles && uploadFiles.length ? this.oneTimeUploadFiles(fileFieldName_, additionalParameter, uploadFiles) : this.parallelUploadFiles(fileFieldName_, additionalParameter);
2296
+ this.xhr.send(formData);
2297
+ this.status = UploadStatus.uploading;
2298
+ this.xhr.onabort = () => {
2299
+ this.status = UploadStatus.preLoad;
2300
+ this.xhr = null;
2301
+ };
2302
+ this.xhr.onerror = () => {
2303
+ this.response = this.xhr.response;
2304
+ this.status = UploadStatus.failed;
2305
+ reject({ file: this.file, response: this.xhr.response });
2306
+ };
2307
+ this.xhr.onload = () => {
2308
+ if (this.xhr.readyState === 4 && this.xhr.status >= 200 && this.xhr.status < 300) {
2309
+ this.response = this.xhr.response;
2310
+ this.status = UploadStatus.uploaded;
2311
+ resolve({ file: this.file, response: this.xhr.response });
2312
+ } else {
2313
+ this.response = this.xhr.response;
2314
+ this.status = UploadStatus.failed;
2315
+ reject({ file: this.file, response: this.xhr.response });
2316
+ }
2317
+ };
2318
+ });
2319
+ }
2320
+ parallelUploadFiles(fileFieldName_, additionalParameter) {
2321
+ const formData = new FormData();
2322
+ formData.append(fileFieldName_, this.file, this.file.name);
2323
+ if (additionalParameter) {
2324
+ Object.keys(additionalParameter).forEach((key) => {
2325
+ formData.append(key, additionalParameter[key]);
2326
+ });
2327
+ }
2328
+ return formData;
2329
+ }
2330
+ oneTimeUploadFiles(fileFieldName_, additionalParameter, uploadFiles) {
2331
+ const formData = new FormData();
2332
+ uploadFiles.forEach((element) => {
2333
+ formData.append(fileFieldName_, element.file, element.file.name);
2334
+ if (additionalParameter) {
2335
+ Object.keys(additionalParameter).forEach((key) => {
2336
+ formData.append(key, additionalParameter[key]);
2337
+ });
2338
+ }
2339
+ });
2340
+ return formData;
2341
+ }
2342
+ cancel() {
2343
+ if (this.xhr) {
2344
+ this.xhr.abort();
2345
+ }
2346
+ }
2347
+ }
2348
+ const useUpload = () => {
2349
+ const fileUploaders = ref([]);
2350
+ const filesWithSameName = ref([]);
2351
+ const checkFileSame = (fileName) => {
2352
+ let checkRel = true;
2353
+ for (let i = 0; i < fileUploaders.value.length; i++) {
2354
+ if (fileName === fileUploaders.value[i].file.name) {
2355
+ checkRel = false;
2356
+ if (filesWithSameName.value.indexOf(fileName) === -1) {
2357
+ filesWithSameName.value.push(fileName);
2358
+ }
2359
+ break;
2360
+ }
2361
+ }
2362
+ return checkRel;
2363
+ };
2364
+ const addFile = (file, options) => {
2365
+ if (options && options.checkSameName) {
2366
+ if (checkFileSame(file.name)) {
2367
+ fileUploaders.value.push(new FileUploader(file, options));
2368
+ }
2369
+ } else {
2370
+ fileUploaders.value.push(new FileUploader(file, options));
2371
+ }
2372
+ };
2373
+ const getFiles = () => {
2374
+ return fileUploaders.value.map((fileUploader) => {
2375
+ return fileUploader.file;
2376
+ });
2377
+ };
2378
+ const getFullFiles = () => {
2379
+ return fileUploaders.value.map((fileUploader) => {
2380
+ return fileUploader;
2381
+ });
2382
+ };
2383
+ const dealOneTimeUploadFiles = async (uploads) => {
2384
+ if (!uploads || !uploads.length) {
2385
+ return Promise.reject("no files");
2386
+ }
2387
+ let finalUploads = [];
2388
+ await uploads[0].send(uploads).finally(() => finalUploads = uploads.map((file) => {
2389
+ file.status = uploads[0].status;
2390
+ file.percentage = uploads[0].percentage;
2391
+ return { file: file.file, response: uploads[0].response };
2392
+ }));
2393
+ return finalUploads;
2394
+ };
2395
+ const upload2 = async (oneFile) => {
2396
+ let uploads = [];
2397
+ if (oneFile) {
2398
+ oneFile.percentage = 0;
2399
+ const uploadedFile = await oneFile.send();
2400
+ uploads.push(uploadedFile);
2401
+ } else {
2402
+ const preFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad);
2403
+ const failedFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.failed);
2404
+ const uploadFiles = preFiles.length > 0 ? preFiles : failedFiles;
2405
+ uploads = await Promise.all(uploadFiles.map(async (fileUploader) => {
2406
+ fileUploader.percentage = 0;
2407
+ const uploadedFile = await fileUploader.send();
2408
+ return uploadedFile;
2409
+ }));
2410
+ }
2411
+ if (uploads.length > 0) {
2412
+ return Promise.resolve(uploads);
2413
+ }
2414
+ return Promise.reject("no files");
2415
+ };
2416
+ const _oneTimeUpload = () => {
2417
+ const uploads = fileUploaders.value.filter((fileUploader) => fileUploader.status !== UploadStatus.uploaded);
2418
+ return dealOneTimeUploadFiles(uploads);
2419
+ };
2420
+ const deleteFile = (file) => {
2421
+ const deleteUploadFile = fileUploaders.value.find((fileUploader) => fileUploader.file === file);
2422
+ deleteUploadFile.cancel();
2423
+ fileUploaders.value = fileUploaders.value.filter((fileUploader) => {
2424
+ return file !== fileUploader.file;
2425
+ });
2426
+ };
2427
+ const removeFiles = () => {
2428
+ fileUploaders.value = [];
2429
+ filesWithSameName.value = [];
2430
+ };
2431
+ const getSameNameFiles = () => {
2432
+ return filesWithSameName.value.join();
2433
+ };
2434
+ const resetSameNameFiles = () => {
2435
+ filesWithSameName.value = [];
2436
+ };
2437
+ return {
2438
+ fileUploaders,
2439
+ getFiles,
2440
+ addFile,
2441
+ getFullFiles,
2442
+ deleteFile,
2443
+ upload: upload2,
2444
+ removeFiles,
2445
+ getSameNameFiles,
2446
+ resetSameNameFiles,
2447
+ _oneTimeUpload
2448
+ };
2449
+ };
2450
+ var upload = "";
2451
+ function _isSlot(s) {
2452
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2453
+ }
2454
+ var Upload = defineComponent({
2455
+ name: "DUpload",
2456
+ props: uploadProps,
2457
+ emits: ["fileDrop", "fileOver", "fileSelect", "deleteUploadedFile", "update:uploadedFiles"],
2458
+ setup(props, ctx) {
2459
+ const {
2460
+ uploadOptions,
2461
+ placeholderText,
2462
+ autoUpload,
2463
+ withoutBtn,
2464
+ uploadText,
2465
+ disabled,
2466
+ beforeUpload,
2467
+ enableDrop,
2468
+ oneTimeUpload,
2469
+ uploadedFiles,
2470
+ multiple,
2471
+ accept,
2472
+ webkitdirectory
2473
+ } = toRefs(props);
2474
+ const {
2475
+ triggerSelectFiles,
2476
+ _validateFiles,
2477
+ triggerDropFiles,
2478
+ checkAllFilesSize
2479
+ } = useSelectFiles();
2480
+ const {
2481
+ fileUploaders,
2482
+ addFile,
2483
+ getFullFiles,
2484
+ deleteFile,
2485
+ upload: upload2,
2486
+ resetSameNameFiles,
2487
+ removeFiles,
2488
+ _oneTimeUpload,
2489
+ getSameNameFiles
2490
+ } = useUpload();
2491
+ const isDropOVer = ref(false);
2492
+ const uploadTips = ref("");
2493
+ const alertMsg = (errorMsg) => {
2494
+ ToastService.open({
2495
+ value: [{
2496
+ severity: "warn",
2497
+ content: errorMsg
2498
+ }]
2499
+ });
2500
+ };
2501
+ const checkValid = () => {
2502
+ let totalFileSize = 0;
2503
+ fileUploaders.value.forEach((fileUploader) => {
2504
+ totalFileSize += fileUploader.file.size;
2505
+ const checkResult = _validateFiles(fileUploader.file, accept.value, fileUploader.uploadOptions);
2506
+ if (checkResult && checkResult.checkError) {
2507
+ deleteFile(fileUploader.file);
2508
+ alertMsg(checkResult.errorMsg);
2509
+ return;
2510
+ }
2511
+ });
2512
+ if (oneTimeUpload.value) {
2513
+ const checkResult = checkAllFilesSize(totalFileSize, uploadOptions.value.maximumSize);
2514
+ if (checkResult && checkResult.checkError) {
2515
+ removeFiles();
2516
+ alertMsg(checkResult.errorMsg);
2517
+ }
2518
+ }
2519
+ };
2520
+ const _dealFiles = (promise) => {
2521
+ resetSameNameFiles();
2522
+ promise.then((files) => {
2523
+ files.forEach((file) => {
2524
+ if (!multiple.value) {
2525
+ removeFiles();
2526
+ }
2527
+ addFile(file, uploadOptions.value);
2528
+ });
2529
+ checkValid();
2530
+ const sameNameFiles = getSameNameFiles();
2531
+ if (uploadOptions.value.checkSameName && sameNameFiles.length) {
2532
+ alertMsg(getExistSameNameFilesMsg(sameNameFiles));
2533
+ }
2534
+ const selectedFiles = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad).map((fileUploader) => fileUploader.file);
2535
+ ctx.emit("fileSelect", selectedFiles);
2536
+ if (autoUpload.value) {
2537
+ fileUpload();
2538
+ }
2539
+ }).catch((error) => {
2540
+ alertMsg(error.message);
2541
+ });
2542
+ };
2543
+ const handleClick = () => {
2544
+ if (disabled.value) {
2545
+ return;
2546
+ }
2547
+ _dealFiles(triggerSelectFiles({
2548
+ accept: accept.value,
2549
+ multiple: multiple.value,
2550
+ webkitdirectory: webkitdirectory.value
2551
+ }));
2552
+ };
2553
+ const onFileDrop = (files) => {
2554
+ isDropOVer.value = false;
2555
+ _dealFiles(triggerDropFiles(files));
2556
+ ctx.emit("fileDrop", files);
2557
+ };
2558
+ const onFileOver = (event) => {
2559
+ isDropOVer.value = event;
2560
+ ctx.emit("fileOver", event);
2561
+ };
2562
+ const deleteUploadedFile = (file) => {
2563
+ const newUploadedFiles = uploadedFiles.value.filter((uploadedFile) => {
2564
+ return uploadedFile.name !== file.name;
2565
+ });
2566
+ ctx.emit("deleteUploadedFile", file);
2567
+ ctx.emit("update:uploadedFiles", newUploadedFiles);
2568
+ };
2569
+ const onDeleteFile = (event, file, status) => {
2570
+ event.stopPropagation();
2571
+ if (status === UploadStatus.uploaded) {
2572
+ deleteUploadedFile(file);
2573
+ }
2574
+ deleteFile(file);
2575
+ };
2576
+ const canUpload = () => {
2577
+ let uploadResult = Promise.resolve(true);
2578
+ if (beforeUpload.value) {
2579
+ const result = beforeUpload.value(getFullFiles());
2580
+ if (typeof result !== "undefined") {
2581
+ if (result.then) {
2582
+ uploadResult = result;
2583
+ } else {
2584
+ uploadResult = Promise.resolve(result);
2585
+ }
2586
+ }
2587
+ }
2588
+ return uploadResult;
2589
+ };
2590
+ const fileUpload = (event, fileUploader) => {
2591
+ if (event) {
2592
+ event.stopPropagation();
2593
+ }
2594
+ canUpload().then((_canUpload) => {
2595
+ if (!_canUpload) {
2596
+ removeFiles();
2597
+ return;
2598
+ }
2599
+ const uploadObservable = oneTimeUpload.value ? _oneTimeUpload() : upload2(fileUploader);
2600
+ uploadObservable.then((results) => {
2601
+ props["on-success"] && props["on-success"](results);
2602
+ const newFiles = results.map((result) => result.file);
2603
+ const newUploadedFiles = [...newFiles, ...uploadedFiles.value];
2604
+ ctx.emit("update:uploadedFiles", newUploadedFiles);
2605
+ }).catch((error) => {
2606
+ props["on-error"] && props["on-error"](error);
2607
+ });
2608
+ });
2609
+ };
2610
+ const getStatus = () => {
2611
+ let uploadingCount = 0;
2612
+ let uploadedCount = 0;
2613
+ let failedCount = 0;
2614
+ const filesCount = fileUploaders.value.length;
2615
+ fileUploaders.value.forEach((fileUploader) => {
2616
+ if (fileUploader.status === UploadStatus.uploading) {
2617
+ uploadingCount++;
2618
+ } else if (fileUploader.status === UploadStatus.uploaded) {
2619
+ uploadedCount++;
2620
+ } else if (fileUploader.status === UploadStatus.failed) {
2621
+ failedCount++;
2622
+ }
2623
+ });
2624
+ if (failedCount > 0) {
2625
+ uploadTips.value = getFailedFilesCount(failedCount);
2626
+ return "failed";
2627
+ }
2628
+ if (uploadingCount > 0) {
2629
+ uploadTips.value = getUploadingFilesCount(uploadingCount, filesCount);
2630
+ return "uploading";
2631
+ }
2632
+ if (uploadedCount === filesCount && uploadedCount !== 0) {
2633
+ return "uploaded";
2634
+ }
2635
+ if (filesCount !== 0) {
2636
+ uploadTips.value = getSelectedFilesCount(filesCount);
2637
+ return "selected";
2638
+ }
2639
+ };
2640
+ const cancelUpload = () => {
2641
+ fileUploaders.value = fileUploaders.value.map((fileUploader) => {
2642
+ if (fileUploader.status === UploadStatus.uploading) {
2643
+ fileUploader.cancel();
2644
+ fileUploader.status = UploadStatus.failed;
2645
+ }
2646
+ return fileUploader;
2647
+ });
2648
+ };
2649
+ return {
2650
+ uploadOptions,
2651
+ placeholderText,
2652
+ autoUpload,
2653
+ withoutBtn,
2654
+ uploadText,
2655
+ disabled,
2656
+ beforeUpload,
2657
+ enableDrop,
2658
+ isDropOVer,
2659
+ onFileDrop,
2660
+ onFileOver,
2661
+ handleClick,
2662
+ fileUploaders,
2663
+ onDeleteFile,
2664
+ fileUpload,
2665
+ getStatus,
2666
+ uploadTips,
2667
+ cancelUpload,
2668
+ deleteUploadedFile,
2669
+ multiple
2670
+ };
2671
+ },
2672
+ render() {
2673
+ var _a, _b, _c, _d, _e, _f;
2674
+ const {
2675
+ placeholderText,
2676
+ autoUpload,
2677
+ withoutBtn,
2678
+ uploadText,
2679
+ disabled,
2680
+ enableDrop,
2681
+ isDropOVer,
2682
+ onFileDrop,
2683
+ onFileOver,
2684
+ handleClick,
2685
+ fileUploaders,
2686
+ onDeleteFile,
2687
+ fileUpload,
2688
+ uploadedFiles,
2689
+ deleteUploadedFile,
2690
+ multiple
2691
+ } = this;
2692
+ return createVNode("div", null, [withDirectives(createVNode("div", {
2693
+ "class": "devui-upload",
2694
+ "style": `border: ${isDropOVer ? "1px solid #15bf15" : "0"}`
2695
+ }, [((_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)) ? createVNode("div", {
2696
+ "onClick": handleClick
2697
+ }, [this.$slots.default()]) : createVNode("div", {
2698
+ "class": `devui-input-group ${disabled ? "disabled" : ""}`,
2699
+ "onClick": handleClick
2700
+ }, [fileUploaders.length === 0 && createVNode("div", {
2701
+ "class": "devui-form-control devui-upload-placeholder"
2702
+ }, [placeholderText]), fileUploaders.length > 0 && createVNode("ul", {
2703
+ "class": "devui-form-control devui-files-list"
2704
+ }, [fileUploaders.map((fileUploader, index2) => createVNode("li", {
2705
+ "key": index2,
2706
+ "class": "devui-file-item devui-file-tag",
2707
+ "style": "display: inline-block; margin: 0 2px 2px 0",
2708
+ "title": fileUploader.file.name
2709
+ }, [createVNode("span", {
2710
+ "class": `evui-filename ${fileUploader.status === UploadStatus.failed ? "devui-failed-color" : ""}`
2711
+ }, [fileUploader.file.name]), createVNode(resolveComponent("d-icon"), {
2712
+ "name": "close",
2713
+ "class": `${(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.failed ? "devui-upload-delete-file-button" : ""} ${(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploading || (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploaded ? "devui-uploading-delete" : ""}`,
2714
+ "onClick": (event) => onDeleteFile(event, fileUploader.file, fileUploader.status)
2715
+ }, null), fileUploader.status === UploadStatus.uploading && createVNode("div", {
2716
+ "class": "icon devui-upload-progress"
2717
+ }, [createVNode(resolveComponent("d-progress"), {
2718
+ "isCircle": true,
2719
+ "percentage": fileUploader.percentage,
2720
+ "barbgcolor": "#50D4AB",
2721
+ "strokeWidth": 8,
2722
+ "showContent": false
2723
+ }, null)]), fileUploader.status === UploadStatus.failed && createVNode(resolveComponent("d-icon"), {
2724
+ "name": "running",
2725
+ "onClick": fileUpload
2726
+ }, null), fileUploader.status === UploadStatus.uploaded && createVNode(resolveComponent("d-icon"), {
2727
+ "name": "right",
2728
+ "color": "#50d4ab"
2729
+ }, null)]))]), createVNode("span", {
2730
+ "class": "devui-input-group-addon"
2731
+ }, [createVNode(resolveComponent("d-icon"), {
2732
+ "name": "more-operate",
2733
+ "color": "#252b3a"
2734
+ }, null)])]), !autoUpload && !withoutBtn && createVNode(resolveComponent("d-button"), {
2735
+ "style": "marginLeft: 8px",
2736
+ "btnStyle": "common",
2737
+ "disabled": disabled,
2738
+ "onClick": fileUpload
2739
+ }, _isSlot(uploadText) ? uploadText : {
2740
+ default: () => [uploadText]
2741
+ })]), [[resolveDirective("file-drop"), {
2742
+ enableDrop,
2743
+ isSingle: !multiple,
2744
+ onFileDrop,
2745
+ onFileOver
2746
+ }]]), createVNode("div", null, [(_d = (_c = this.$slots).preloadFiles) == null ? void 0 : _d.call(_c, {
2747
+ fileUploaders,
2748
+ deleteFile: onDeleteFile
2749
+ })]), createVNode("div", null, [(_f = (_e = this.$slots).uploadedFiles) == null ? void 0 : _f.call(_e, {
2750
+ uploadedFiles,
2751
+ deleteFile: deleteUploadedFile
2752
+ })])]);
2753
+ }
2754
+ });
2755
+ const getTransfer = (event) => {
2756
+ var _a;
2757
+ return event.dataTransfer ? event.dataTransfer : (_a = event.originalEvent) == null ? void 0 : _a.dataTransfer;
2758
+ };
2759
+ const haveFiles = (types) => {
2760
+ if (!types) {
2761
+ return false;
2762
+ }
2763
+ if (types.indexOf) {
2764
+ return types.indexOf("Files") !== -1;
2765
+ } else if (types.contains) {
2766
+ return types.contains("Files");
2767
+ } else {
2768
+ return false;
2769
+ }
2770
+ };
2771
+ const preventAndStop = (event) => {
2772
+ event.preventDefault();
2773
+ event.stopPropagation();
2774
+ };
2775
+ const onDragOver = (el, binding) => {
2776
+ const { onFileOver } = binding.value;
2777
+ el.addEventListener("dragover", (event) => {
2778
+ const transfer = getTransfer(event);
2779
+ if (!haveFiles(transfer.types)) {
2780
+ return;
2781
+ }
2782
+ preventAndStop(event);
2783
+ onFileOver && onFileOver(true);
2784
+ });
2785
+ };
2786
+ const onDragLeave = (el, binding) => {
2787
+ const { onFileOver } = binding.value;
2788
+ el.addEventListener("dragleave", (event) => {
2789
+ if (event.currentTarget === el) {
2790
+ return;
2791
+ }
2792
+ preventAndStop(event);
2793
+ onFileOver && onFileOver(true);
2794
+ });
2795
+ };
2796
+ const onDrop = (el, binding) => {
2797
+ const { onFileDrop, isSingle } = binding.value;
2798
+ el.addEventListener("drop", (event) => {
2799
+ const transfer = getTransfer(event);
2800
+ if (!transfer) {
2801
+ return;
2802
+ }
2803
+ preventAndStop(event);
2804
+ if (isSingle) {
2805
+ onFileDrop && onFileDrop([transfer.files[0]]);
2806
+ } else {
2807
+ onFileDrop && onFileDrop(Array.from(transfer.files));
2808
+ }
2809
+ });
2810
+ };
2811
+ const fileDropDirective = {
2812
+ mounted: (el, binding) => {
2813
+ const { enableDrop } = binding.value;
2814
+ if (!enableDrop) {
2815
+ return;
2816
+ }
2817
+ onDragOver(el, binding);
2818
+ onDragLeave(el, binding);
2819
+ onDrop(el, binding);
2820
+ }
2821
+ };
2822
+ Upload.install = function(app) {
2823
+ app.directive("file-drop", fileDropDirective);
2824
+ app.component(Upload.name, Upload);
2825
+ };
2826
+ var index = {
2827
+ title: "Upload \u4E0A\u4F20",
2828
+ category: "\u6570\u636E\u5F55\u5165",
2829
+ status: "100%",
2830
+ install(app) {
2831
+ app.use(Upload);
2832
+ }
2833
+ };
2834
+ export { Upload, index as default };